libfirm
qbe-rs
Our great sponsors
libfirm | qbe-rs | |
---|---|---|
2 | 18 | |
390 | 42 | |
3.1% | - | |
0.0 | 5.3 | |
11 days ago | 3 months ago | |
C | Rust | |
GNU Lesser General Public License v3.0 only | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
libfirm
-
Do you consider LLVM a complicated software? And are there any alternatives and how they compare to LLVM?
An alternative: LibFirm but it's much simpler and feature-poor.
-
Suggestion for a backend?
libFirm.
qbe-rs
-
Few lesser known tricks, quirks and features of C
I think QBE might be what you're looking for?
-
Do you consider LLVM a complicated software? And are there any alternatives and how they compare to LLVM?
As far as I know, there is QBE, which is actually kinda underrated, and Cranelift, mainly designed for JIT compilation
Before that, I had spent a bit of time working with QBE, which is much simpler and really easy to write a frontend for. I switched to libgccjit though, because I got frustrated with a few of the things lacking from QBE (like the ability to easily keep track of where different variables live on the stack). I think for many hobby language projects, QBE would be a good option (my project was off the ground very fast using QBE, and I got pretty far before I ran into limitations I couldn't easily work around).
If one of your parameters is size/complexity of the backend and you prefer something smaller, have a look at qbe and cwerg
The alternatives are generally hidden inside of another compiler. The big exception seems to be qbe (https://c9x.me/compile/) however since the author appears to have written this code without peer review, it's not easy to read it's source code.
-
Smallest possible self-hosting zig compiler
So my question is this: if a backend like QBE (~12k Loc) was added to Zig and Zig only had to compile Zig code (no C, etc) for that QBE backend -- about how many LoC would that Zig need to be?
-
Building the fastest Lua interpreter.. automatically
GCC is written in C++ these days, so something like QBE(https://c9x.me/compile/) would be needed.
-
Suggestion for a backend?
QBE https://c9x.me/compile/
-
Ask HN: Recommendation for general purpose JIT compiler
Not mentioned yet: QBE (https://c9x.me/compile/)
Although I might recommend interpreter optimizations before you go straight to machine code. While writing a just-in-time compiler for your DSL will remove interpretation overhead in software and in hardware, you will probably want to have more type information so that you can generate better code. Check out my PL resources page, which has multiple sections on runtime optimization: https://bernsteinbear.com/pl-resources/
The usual recommendation have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly written in C:
- QBE [1] - small compiler backend with nice IL
- DynASM [2] - IIUC the laujit's backend, that can and is used by other languages
- uBPF - Userspace eBPF VM. Depending on your DSL the eBPF toolchain could fit your use-case, but this would probably be the biggest excursion.
What are some alternatives?
minivm - A VM That is Dynamic and Fast
mir - A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
ubpf - Userspace eBPF VM
Som - Parser, code model, navigable browser and VM for the SOM Smalltalk dialect
Oberon - Oberon parser, code model & browser, compiler and IDE with debugger
Befunge - lang befunge 93 fast
cproc - C11 compiler (mirror)
asmjit - Low-latency machine code generation
well - The Future of Assembly Language. https://wellang.github.io/well/
c4 - C in four functions
simplelanguage - A simple example language built using the Truffle API.
go.vm - A simple virtual machine - compiler & interpreter - written in golang