Abrase (.abe, abbreviated Abe) is a Rust-inspired language. Abrase source compiles to Polka bytecode, which runs on the Myriad runtime.
It features:
- Strong typed
- Algebraic effects
- Region memory lifecycle design - no GC, leak free
- Linter & Debugger
It can be added to any Rust application. See wiki.
Try it now in browser.
Transpile to Rust is WIP.
cargo install abrase-cli
# and use
abrase run hello.abe
abrase disasm examples/nqueens.abeOr download pre-compiled GitHub Releases.
effect Metric {
op record(msg: String) -> Unit
}
fn fib(n: Int) -> <Metric> Int {
Metric.record("entering fib({n})");
if n < 2 { n } else { fib(n - 1) + fib(n - 2) }
}
fn main() -> Int {
handle fib(10) {
return v => v,
Metric.record msg => {
println(msg);
resume(())
}
}
}Generally 1.3~2x better than CPython. On specific smaller tasks, could be ~10x faster. See Wiki / Optimizations.
Reproduce with hyperfine.
- 46 opcodes, 4 bytes each. Data & opcode are aligned.
- 128 registers per frame.
See Wiki / Bytecode Spec.
Read about the blog here.