Skip to content

xor-bits/ion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ion

Simple type-inferred statically-typed language

// currently working:
fn add(l: i32, r: i32): i32 {
    return l + r;
}

fn main(): none {
    print(add(4, 5));
    let x = 6;
    print(x);
    x *= 2;
    print(x);
}

// todo:

// optionally fully type-inferred
fn add(l, r) {
    // undecided: optional semicolons
    // limited syntax
    l + r
}

// statements in module level
// str sum (concat)
print(add("Hello, ", "world!"))
print(add(4, 5))

// format strings
print(f"4+5={add(4, 5)}")

// anon.functions / lamdas / closures
let sub = fn(a, b) {
    a - b
}

let x = 5
fn captures() {
    print(x)
}
captures()

// undecided: partial eval using captures
// not very readable?
let add_5 = add(5)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published