QBE reimplemented in MoonBit: the optimizer pipeline plus a programmatic IR builder, an in-memory aarch64 JIT, and LoongArch64/WASM backends
Dependencies
A QBE reimplementation in MoonBit — the upstream compiler plus a programmatic IR builder, an in-memory JIT, and LoongArch64/WASM backends
curl -fsSL https://i2pl.com/install-qbe-mbt.sh | shgit clone https://github.com/azhzx/qbe.mbt.git
cd qbe.mbt
./scripts/bootstrap.sh +--------------------------------------------+
| qbe.mbt - QBE reimplemented in MoonBit |
+--------------------------------------------+
[1/3] MoonBit compiler
How should we get the MoonBit compiler?
1) Use the moon on PATH (/Users/you/.moon/bin/moon)
2) Install MoonBit (Homebrew / install.sh)
3) Use a custom moon path
Choose [1]:
[2/3] Building qbe
/Users/you/.moon/bin/moon build --target native
ok built _build/native/debug/build/cmd/main/main.exe
[3/3] Shell integration
Add qbe to your PATH (install to /Users/you/.local/bin) [Y/n]
ok installed /Users/you/.local/bin/qbe
ok added /Users/you/.local/bin to /Users/you/.zshrc
qbe.mbt is ready../scripts/bootstrap.sh --skip-install # use the moon on PATH, never install
./scripts/bootstrap.sh --install-moon # install MoonBit, then build
./scripts/bootstrap.sh --moon /opt/moon/bin/moon
./scripts/bootstrap.sh --yes --no-path # scripted build, leave PATH alone
./scripts/bootstrap.sh --with-reference # also build vendor/qbe (diff tests)git clone https://github.com/azhzx/qbe.mbt.git
cd qbe.mbt
./scripts/bootstrap.ps1fn compile_ir_bin_module_ex(funcs : Array[Fn], datas : Array[Dat], typs : Array[Typ], interner : Interner) -> (Arm64BinModule, Arm64BinFixups) raisefn interpret(src : String, entry? : String, args? : Array[InterpValue], max_steps? : Int, max_depth? : Int, hook? : (String, Array[InterpValue]) -> InterpValue??) -> Result[(InterpValue, String), QbeError]Install
Download zipQBE reimplemented in MoonBit: the optimizer pipeline plus a programmatic IR builder, an in-memory aarch64 JIT, and LoongArch64/WASM backends
Dependencies