Skip to content

xor-bits/ion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ion

Example code

// all functions are anonymous
let double = fn(num: isize): isize {
    // trailing semicolon can be omitted to return
    // from a scope just like in Rust
    num * 2
};

let four = 4;
let main = fn() {
    print("(1 + 4 * 6) * 2 = ");
    // int literals default to isize
    print(double(1 + four * 6));
    print("\n");
};

Usage

0.16.x Zig compiler is required

# build the transpiler
zig build
# run the transpiler (ion-stage0 <src> <output>)
./zig-out/bin/ion-stage0 ./src/stage1/main.ion out.zig
# run the generated Zig code
zig run -lc out.zig

# or everything in one command (-Ddump is optional)
zig build run -Ddump # -Ddump dumps the generated Zig code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors