Skip to content

chickenbreeder/ella

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ella

Build Status

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

Examples

Basic

cargo run -F wat -- compile test/add.ella -f wat with

test/add.ella

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))
)

Importing functions

test/import.ella

from console import fn log(n: Int);

export fn hello(): Int {
    log(42);
    return 1;
}

About

A small programming language that targets WASM

Resources

License

Stars

Watchers

Forks

Languages