Re:What I Learned Making My Own JIT Language
by zbentley on Wednesday June 27, 2018 @09:42PM
(#17413434)
> How about a language that loses the ability to redefine structures and methods after a certain point?
Sounds awesome! We could call the phases before that point "compile time" and "preprocessor time", and the phase after that point "run time".
/sarc
Re:What I Learned Making My Own JIT Language
by yorwba on Wednesday June 27, 2018 @11:59PM
(#17413966)
Most languages lack one of these phases. C/C++ and the C preprocessor are completely different languages, you can't execute C code during preprocessing. That's annoying and the reason for the introduction of constexpr in C++11. Other languages are too dynamic to be handled by a static compiler, but might benefit if you could transition to optimized machine code at runtime. Except for Lisp, I don't think there are many other languages where such a thing is possible.
Re:What I Learned Making My Own JIT Language
by white-flame on Wednesday June 27, 2018 @04:58PM
(#17411817)
Or even just a manual bake() call, with an expensive unbake() to use during development (or maybe even deployed if it's that reconfigurable). But I do agree that a tool like this should affect the global environment and not try to be fine grained. Leave any fine-grained decisions up to the VM itself.
Re:What I Learned Making My Own JIT Language
by yorwba on Wednesday June 27, 2018 @08:50PM
(#17413185)
That's how RPython works, essentially. https://rpython.readthedocs.io/en/latest/getting-started.htm...
Re:What I Learned Making My Own JIT Language
by staticassertion on Wednesday June 27, 2018 @09:27PM
(#17413368)
Sounds like macros.
I've been thinking of making a scripting language where you can freely redefine things until you return the main function to the script's caller. At that point main gets compiled / JITed / otherwise locked and any redefinitions done by calling it are errors.