4 ms·
I think the right model for compile-time evaluation is to have an interpreter and phases, making the full language available at compile-time but clearly disting
by jonathanstrange 10y ago
I think the right model for compile-time evaluation is to have an interpreter and phases, making the full language available at compile-time but clearly distinguishing between compile-time, macro-expansion, module elaboration and runtime phases. Scheme dialects generally do that, although they should maybe define module visiting and elaboration orders in general more clearly like e.g. Ada does.
I don't know if Zig does that. Anyway, having different phases is not conceptually hard, although it can bite you a bit with Macros in Scheme.
- billsix 10y agoIn my project, http://billsix.github.io/cac.html http://billsix.github.io/cac.html, the Compile-Time language is the same as the runtime language. Tests are collocated with procedure definitions, but evaluate only at Compile-Time.