I had to stick with php at that point / am still thinking on migrating.
For this particular case, I think my approach was that instead of using a list, I would output each slug in a separate file (numbered 0.txt, 1.txt, etc. / updating their contents periodically) and include them in turn, one per #get.
Simply can’t remember how the including would work exactly, but i think it was possible somehow or I would have asked about that as well.
L.E. or maybe not! Working with static data
(mind you, the actual popularity classification has to be done outside ghost / even with wp, I’m using nginx+lua to effectively count the hits, do the ordering and output the files / all that the cms has to do is import the output)