4 ms·
LLVM is not a language, it’s a C++ library. There also happens to be a printer and parser for a textual representation of the IR, but it’s far from complete and
by slavapestov 3y ago
LLVM is not a language, it’s a C++ library. There also happens to be a printer and parser for a textual representation of the IR, but it’s far from complete and doesn’t let you do many things the C++ allows.
The downside is that your frontend pretty much has to be written in C++ (or you maintain your own bridging wrapper library like Rust does).
For a hobby project, go with whatever is easiest. If you’re a C++ programmer and don’t mind writing your frontend in C++, take a look at LLVM. Writing an interpreter is also a valid choice. You can still learn a lot about compiler design by targeting a suitable bytecode format instead of a real CPU.
Production compilers these days either target the LLVM C++ API or have their own code generation backend.