
Am 08.10.2018 um 09:08 schrieb Gleb Popov:
Laziness? No problem. If you do tagless/spineless, you'll code the evaluation machine anyway. Just add an IR instructions that calls the interpreter.
I'm far from expert in this area, but isn't that "interpreter" a simple yet slow approach to codegen? My understanding is that when you use, say, a global variable as a register for your evaluation machine, it is slower than if you somehow pin real hardware register for that purpose. I think this is what "registerized" GHC build means.
My impression has been that GHC is compiling everything down to machine code. FWIW most mentions I saw were of the kind "we replace tagless/spineless with X", not of the "we build on tagless/spineless doing Y". Not that I have read many papers - I'm awfully behind on these topics.
In LLVM you can't use, say, RSP in a way you want, but it is doomed to be "stack pointer register", even if you don't use stack at all.
Actually it seems possible since some version between 3.4 and 3.6. https://stackoverflow.com/questions/29365198/how-to-use-llvm-intrinsics-llvm... discusses a way of doing exactly that. Not sure about ramifications though. Still, seeing how many wildly varying languages use LLVM for code generation, it seems to be widely considered to be the most flexible available one. If somebody knows of something more flexible, paint me interested :-) Regards, Jo