3 ms·
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.
by lucrbvi 5mo ago
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.
- heavensteeth 5mo agoThis is exactly my gripe unfortunately, it feels like needless fragility. IIRC the author has said they believe it wouldn't be too difficult to patch QBE to work as a library, but from what I've seen the code is somewhat terse and eccentric.
- fuhsnn 5mo agoThere is a library conversion fork: https://github.com/sgraham/sqbe https://github.com/sgraham/sqbe. IMO when the intended usage is AOT with an external assembler, which is another subprocess, text-based IO is actually the more natural approach.
- mamcx 5mo agoTangentially: Is there a Rust alternative similar to this?
- sparky4pro 5mo agoThere are at least 2 Go libraries written in Go, based on QBE. One is used by this project: https://github.com/xplshn/gbc https://github.com/xplshn/gbc
- duped 5mo agoWhy not? Processes are cheaper than you might think. GCC invokes several as an example.
- rurban 4mo agoBecause 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.