Created
February 21, 2018 23:02
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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