13 comments

[ 3.5 ms ] story [ 49.1 ms ] thread
Cool project, and FWIW it's like one Claude prompt to add MIPS support to this. I did that and then was able to compile my little custom language to the N64.
Do you know if there is ongoing work to support x86_64 on Windows?
Yes, windows support already merged to main so it will be in 1.3
I really like QBE but I hope they will make it a true library because I don't want to launch a subprocess to compile a program.
Why not? Processes are cheaper than you might think. GCC invokes several as an example.
Because this concept only works for offline compilers, but not for dynamic languages. It's about 100x slower.

I'm just converting the call to an external assembler in my compiler rcc to assemble the bytes directly. No need for strings and external files. The cost of the external call is outrageous.

A, c9x among codemadness, cool people, among gopher://bitreich.org

https://codemadness.org/git/

Tons of these tools I use are from these guys (among 2f30). Small, predictable, usable, such as pointtools and catpoint. Sfeed for RSS, scc for gopher and so on, and smu for markdown from git repos > html.

Combined with cproc, I get 70% of gcc -O2, for a small fraction of the code... and a plain and simple C coded compiler.
IR description here: https://c9x.me/git/qbe.git/tree/doc/il.txt

It looks like it doesn't have native support for identifying GC roots, so it's either conservative GC or explicit stack management. I would really like to see something that is (mostly) memory-safe and has string-as-bytes. It's a bit wild that people use Chez Scheme as a target IR for lack of better options.

Looks like a new 1.3 release is coming very soon.

I love QBE, but it does have its limitations: - It handles the ABIs for passing and returning structures in registers, but only with superfluous copies to and from the stack. - Can't generate debug info for data. This is probably due to lack of assembler support and/or complexity in the DWARF format. - The line number debug info directives are currently undocumented and don't support inlined functions.

But it's smol, effective, and it doesn't make you deal with phi nodes!