Hacker News new | ask | show | jobs
by ssp 5573 days ago
Yes, you can generate machine code yourself, but then you have to write machine code ...

I'm suggesting a JIT compiler as a built-in language feature so that you could write code in a high-level language and have machine code generated that was specialized based on the program's dynamic state.

It could be done as a library, but it would benefit from language integration so that you wouldn't have to write the code as strings or ASTs.

1 comments

Language integration would be nice, however dynamic code generation from a library has been about for some time now:

"With libtcc, you can use TCC as a backend for dynamic code generation." from http://bellard.org/tcc/