https://github.com/xor-bits/ion
https://github.com/xor-bits/ion
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/xor-bits/ion
- Owner: xor-bits
- Created: 2023-01-23T13:18:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T10:33:57.000Z (almost 3 years ago)
- Last Synced: 2025-02-08T06:16:49.203Z (over 1 year ago)
- Language: Rust
- Size: 201 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ion
Simple type-inferred statically-typed language
```rust
// 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)
```