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

Fascinating! I wonder if there's a way to keep this 100% inside the C ecosystem, without having to reach for an LLVM dependency...


No need to wonder - the article clearly explains why there isn't. That's why they made this tool in the first place!


In general, probably, you'd have to replace the part where he writes the LLVM IR directly to say GCC's IR. If you mean no IR at all it doesn't sound like it based on the part about replacing the assembly from LuaJIT.


GCC is written in C++ these days, so something like QBE(https://c9x.me/compile/) would be needed.


Not C, but could probably do it with Rust & Cranelift's IR instead of LLVM's. Not as heavy weight of a dependency as bringing in LLVM.


I just want to point out that LLVM is not a runtime dependency. It is only a build-time dependency if you want to build LJR from source. Once LJR is built, it is stand-alone and does not need LLVM at runtime.


Do other JIT developers who would want to use Deegen need to pull in LLVM as a dependency still?


It should be a build time dependency. There's no JIT here, so there's no calling into LLVM's JIT, so I'd hope it's equivalent to using clang to create a native binary that implements the lua language.

Could probably retarget it to emit assembly and commit that for a loose interpretation of building from source.


Sure, you’d just pick a language that has a flexible optimizing compiler and generate code using that instead.




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

Search: