yasl
yasl copied to clipboard
Bytecode Interpreter for Yet Another Scripting Language (YASL).
Currently, there is no way for a user to exit from YASL code in cases of error. ``` if (something) { error('Could no do ...'); } ``` allows users to...
`glob` like syntax for this is probably sufficient, rather than full regex
Currently, a similar form is supported for function parameters. For consistency, allow this for variable declarations too.
This would allow doing things like enforcing no mutating of metatables for built-in types, as an example. Not sure if the added complexity is worthwhile however.
Allow writing something like `using list = collections.list`, which would be equivalent to `let list = collections.list`. We also allow multiple declarations at once (`using collections.list, collections.set, collections.table`), and we...
something like ``` const set = collections.set match collections.set(1, 2, 3) { set(1, 2, 3) { echo 'it matches!' } } ``` Some open questions: - When (in terms of...
YASL could possibly have user-defined literals. This would allow things like `let pattern = r"\d+"` to represent a regex literal. The advantage of these over a constructor function is that...
Currently, every variadic except for the empty one can be represented. Use `()` to represent the empty variadic.
`const fn f() -> 1, 2, 3` should work, instead of requiring writing `const fn f() -> (1, 2, 3)`.
so: ``` const fn f() -> (1, 2, 3) echo (f()) # 1 echo f() # 1, 2, 3 ```