Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Probably doesn't count as "high level" but you can embed the LLVM compiler backend to your project and compile and optimize code at runtime.

See the LLVM "Kaleidoscope" tutorials from the LLVM docs. They implement a simple toy compiler with a JIT-based REPL. Basically you use the LLVM framework to build a program and then run it through the compiler pipeline and get a callable function pointer to your newly compiled function(s), optimized for the CPU architecture you're running on.



I've seen people use that for compiling regular expressions to LLVM assembly at run time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: