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.
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.
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.
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.
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!
13 comments
[ 3.5 ms ] story [ 49.1 ms ] threadI'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.
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.
https://news.ycombinator.com/item?id=48058644
There’s also cproc which has a few HN posts about it.
https://news.ycombinator.com/item?id=24076603 https://news.ycombinator.com/item?id=28242024 https://news.ycombinator.com/item?id=32466098 https://news.ycombinator.com/item?id=25273918
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.
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!