Skip to content

Instantly share code, notes, and snippets.

@akoskovacs
Created March 7, 2020 02:35
Show Gist options
  • Save akoskovacs/ccd20ef675e9ee4f4e84ac8ef43d6c20 to your computer and use it in GitHub Desktop.
Save akoskovacs/ccd20ef675e9ee4f4e84ac8ef43d6c20 to your computer and use it in GitHub Desktop.
rayson.json
[
["function", ["hello", [], [
["call", ["console", "log"], ["hello, world"]],
["return", []]
]
]
],
["function", ["addTwoNums", ["a", "b"], [
["return", [
["+", ["a", "b"]]
]
]
]
]
],
["function", ["powersTwo", ["endNum"], [
["var", ["n", 1]],
["for", [["var", ["i", 1]], ["<=", ["i", "endNum"]], ["++", "i"]], [
["=", ["n"], ["*", ["i", "i"]]],
]
],
["return", ["i"]]
]
]
],
["function", ["selfModify", [], [
["call", ["push", ["@2", [["return", [42]]]]]],
["return", [10]]
]
]
],
["main", [
["call", ["hello"], []],
["call", ["window", "alert"], [["call", ["powersTwo", [1024]]]]],
["return", [0]]
]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment