A small programming language that can be compiled to WebAssembly (binary and text format).
Usage: ella <COMMAND>
Commands:
compile Compile a file to WASM
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
cargo run -F wat -- compile test/add.ella -f wat with
export fn add(a: Int, b: Int): Int {
let c: Int = a + b;
return c;
}as the input program currently yields following result:
(module
(type (;0;) (func (param i32 i32) (result i32)))
(func $add (;0;) (type 0) (param $a i32) (param $b i32) (result i32)
(local $c i32) (local i32)
local.get $a
local.get $b
i32.add
local.set $c
local.get $c
)
(export "add" (func $add))
)from console import fn log(n: Int);
export fn hello(): Int {
log(42);
return 1;
}