qbe-rs
Oberon
Our great sponsors
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- InfluxDB - Access the most powerful time series database as a service
- SonarLint - Clean code begins in your IDE with SonarLint
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
qbe-rs | Oberon | |
---|---|---|
23 | 68 | |
45 | 341 | |
- | - | |
4.6 | 4.9 | |
5 months ago | 10 days ago | |
Rust | C++ | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 only |
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.
qbe-rs
-
Made my first LLVM front-end… Now what?
You can try buildling you own backend like llvm. A good example or starting point is probably QBE since it is extremely small but very functional.
- Best book on writing an optimizing compiler (inlining, types, abstract interpretation)?
-
Rust port of B3 from WebKit, LLVM-like backend
How big is the whole backend? I've heard that it is small but I wanted to compare it to QBE which is around 8 KLoC and it is quite interesting too.
-
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.
Oberon
- Do transpilers just use a lot of string manipulation and concatenation to output the target language?
-
Native AOT Overview
> annoying aspects was requiring the .NET runtime ... OpenJDK is a blessed implementation in a way that Mono never was
Which is unjustified, because Mono CLR is just a single executable less than 5 MB which you can download and run without a complicated installation process (see e.g. https://github.com/rochus-keller/Oberon/#binary-versions ). AOT compilation on the other hand is a huge and complex installation depending on a lot of stuff including LLVM, and the resulting executables are not really smaller than the CLR + mscorlib + app.
-
Does the JVM / CLR even make sense nowadays?
After evaluating a lot of different technologies I'm e.g. using the Mono CLR for my Oberon+ IDE because it is lean, fast and has also excellent platform independent debugging features, and also an integrated, mostly standardized and platform independent FFI (see https://github.com/rochus-keller/Oberon). It is more stable than LuaJIT and the same benchmark suit runs twice as fast on Mono than on LuaJIT (see https://github.com/rochus-keller/Oberon/blob/master/testcases/Are-we-fast-yet/Are-we-fast-yet_results_linux.pdf). Mono is also still fast enough compared to more recent CLR versions (see https://www.quora.com/Is-the-Mono-CLR-really-slower-than-CoreCLR/answer/Rochus-Keller). For the AOT use-case my compiler generates C for another factor two in speed when compiled e.g. with GCC -O2. You could even use the AOT feature of Mono for the same purpose.
-
How fast is JIT compiled Lua/JavaScript compared to static compiled C++ and Rust measured in runtime?
1: https://github.com/rochus-keller/Oberon/blob/master/testcases/Are-we-fast-yet/Are-we-fast-yet_results_linux.pdf
-
Useful lesser-used languages?
Oberon? see https://github.com/rochus-keller/Oberon/
-
Ask HN: What programming languages are you excited about?
My new BUSY build system specification language (https://github.com/rochus-keller/BUSY/blob/main/README.md) and of course Oberon+ (https://github.com/rochus-keller/Oberon/blob/master/README.m...).
-
What do you think about a C transpiler?
My Oberon compiler (https://github.com/rochus-keller/Oberon) does exactly that. But the C transpiler is only used when development and debugging are done, because debugging based on the generated C code makes everything much more complicated and platform dependent. Instead my compiler also generates CLI IL so I can use the excellent, lean, and cross-platform Mono engine integrated with my IDE re-using the Mono performance and debugging features; this is transparent to the developer; just in the end he/she generates (platform independent) C code and compiles it using e.g. GCC, CLANG or MSVC.
-
Thoughts on building on a VM (in particular, .NET/CLR) but not "exposing" the underlying VM?
Interesting, thanks for the links, I will have a look at them. I used both the J2EE and .NET frameworks in the past. My major current interest in .NET is the CLR and CIL which I use in https://github.com/rochus-keller/Oberon/. I wouldn't switch since the Mono CLR is very good, but if there was a lean, improved version of the JVM I might consider generating bytecode for it.
That sounds rather similar to what I did with my Oberon+ implementation (see https://github.com/rochus-keller/Oberon/). I'm using Mono instead of CoreCLR, because it is leaner and runs on more architectures. Some versions of Mono turned out to be even faster than CoreCLR (see https://www.quora.com/Is-the-Mono-CLR-really-slower-than-CoreCLR/answer/Rochus-Keller). My Oberon IDE includes the mono executable plus the mscorlib.dll (together less than 10 MB); the IDE communicates with the mono debugger via the official socket interface.
-
Open source vs proprietary compiler
Did you have a look at Oberon? This is the language Prof. Wirth especially conceived for education of computer science students at ETH Zurich where it was successfully used for many years; also some other universities adopted it. If you don't like the original syntax, there is also a more modern version incl. IDE and debugger, still adhering to simplicity: https://github.com/rochus-keller/Oberon
What are some alternatives?
oberon-riscv - Oberon RISC-V port, based on Samuel Falvo's RISC-V compiler and Peter de Wachter's Project Norebo. Part of an academic project to evaluate Project Oberon on RISC-V.
MoarVM - A VM with adaptive optimization and JIT compilation, built for Rakudo
Smalltalk - Parser, code model, interpreter and navigable browser for the original Xerox Smalltalk-80 v2 sources and virtual image file
tectonic - A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
aws-lambda-rust-runtime - A Rust runtime for AWS Lambda
spec - WebAssembly specification, reference interpreter, and test suite.
atldotnet - Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
core - Home repository for .NET Core
nappgui - Cross-Platform C SDK (precompiled)
wasmtime - A fast and secure runtime for WebAssembly
are-we-fast-yet - Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
minivm - A VM That is Dynamic and Fast