7 comments

[ 1.8 ms ] story [ 11.2 ms ] thread
Thanks for sharing. Very interesting. I wasn't aware of Cranelift. Will read.

What are people's thoughts on the current state of the art in using Cofe generation for higher level and lower level development?

There's a lot of JIT's using LLVM for code generation. Including some shader compilers, Azul's JVM, and I believe Safari's JS.

DynASM is another popular library, used by Lua and others.

Crane lift was originally designed for WASM but Rust developers have taken a liking to it

My favorite flavor of code-gen is within VM based languages though. I'm most familiar with Java, where there's a rich set of libraries for generating code at build and run time. Codegen within JIT'ed languages is really cool because the new code is patched into the existing code with profile guided optimizing compilers.

A lot of popular libraries use it. And it's nice to know it's there if you need to build up say a deserializer or rules engine with maximum performance.

I'd love it if there was a guide/tutorial on how to use it as an alternative to LLVM.
I dunno that it is meant to be a full on replacement. Rust intends to use it as an alternative backend for debug builds that focuses on really fast build times with little if any optimizations.
It's not, but I'm also not intending to write a production grade language either.