6 ms·
> Terra programs use the same LLVM backend that Apple uses for its C compilers. Can it use anything else (as an option), e.g. Lua? That would be useful during
by trott 2y ago
> Terra programs use the same LLVM backend that Apple uses for its C compilers.
Can it use anything else (as an option), e.g. Lua? That would be useful during development/debugging thanks to faster iteration and memory safety.
- transpute 2y agoLLVM would not be easily replaced, https://chriscummins.cc/2019/llvm-cost/ https://chriscummins.cc/2019/llvm-cost/ > 1.2k developers have produced a 6.9M line code base with an estimated price tag of $530M.
- ajb 2y agoAlthough it's true that replacing LLVM like-for-like would indeed be expensive, I feel like you missed GP's point. To make the easier to debug, what you want is to replace LLVM with something simple, like a plain interpreter. And writing one (or adapting one) would be nothing like this cost.
- transpute 2y agoAny precedent example for an LLVM-hosted language? There are benefits from being on the same toolchain as popular languages.
- dvtkrlbs 2y agoRust is experimenting with a codegen tool called cranelift which powers wasmtime. The plan is to use it for debug builds. There is also a backend implementation in the works using gcc jit and a dotnet backend as well
- brabel 2y agoZig is actually trying to get rid of LLVM for default builds, though they intend to keep it as one of the "backends" for the forseeable future. The problem is that LLVM is very slow (as it applies lots of optimisations) and heavy, and that makes a compiler slow even in debug mode. D has 3 backends, LLVM is used by the LDC compiler. Then there's DMD which is the official compiler (and frontend for all three), and GDC which uses GCC backend. D code typically compiles quite a bit faster on DMD, but the code is more highly optimised with LLVM or GCC, of course. It's a great tradeoff specially since all compilers use the DMD frontend so it's almost guaranteeed that there's no differences in behaviour between them.
- 1oooqooq 2y agothat's a fallacy that was ignored when starting llvm and looking at the already existing gcc.