Conversation

Mind is getting blown by multi-stage programming! Does anyone know of any simple examples of it being used as a way of doing offline partial evaluation in compilation? Most of the stuff I see is for run-time code generation. 🤔
3
4
I think there is some correspondence, but I don't know. The annoying thing about full spectrum dependent types is that you lose the phase information that is present in traditional languages, so it's hard to compile things like type parameters and constant parameters efficiently.
2
Replying to
Ah, I think I see what you're saying. Have some partial evaluation and do specialization at run time based on the types passed. Is that right? A JIT would solve the problem, no? Is the question about partial evaluation to reduce JITting overhead? Not sure where staging comes in.
1
I want this to be ‘offline’ - ie. at compile time, for systems programming purposes. I also want the programmer to know when they break these optimisations - ie. as a type error.
1
Show replies