Skip to content

Instantly share code, notes, and snippets.

@46bit
Created February 21, 2018 23:02
Show Gist options
  • Select an option

  • Save 46bit/8bf1c49e4f1e977a00e179e883e93d4b to your computer and use it in GitHub Desktop.

Select an option

Save 46bit/8bf1c49e4f1e977a00e179e883e93d4b to your computer and use it in GitHub Desktop.
This would be a good start for a general-purpose language. By adding a string type to this example, and adding a special system library, you could program basic servers and the like.
import('math/*')
import('./g')
f(a: i64, b: i64, c: i64) -> (i64, i64) {
x = a + 5;
y = b * c * x;
(x, y)
}
main(inputs: [i64]) -> i64 {
a = inputs[0];
b = inputs[1];
c = inputs[2];
x, y = f(a, b, c);
z = saturating_sub(g(c, y), 5);
print(x);
print(z);
return (x * z) / 64;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment