riff
riff copied to clipboard
The Riff programming language
The lack of dedicated booleans (`true`, `false`) is kind of a [Norman door](https://uxdesign.cc/intro-to-ux-the-norman-door-61f8120b6086) for a high-level language. Adding support for booleans is trivial; the only thing to really figure out...
E.g. ```riff t = { [101] = 1, 2, // Index 102 foo = bar // t.foo or t["foo"] } ```
Self-explanatory ```riff fn foo(x = 1, y = 2) { // ... } ``` cc: #34
Each `riff_code` object contains "metadata" needed only during compilation. There may be a tiny performance boost available by decoupling these fields from the `riff_code` struct.
Todo: add benchmarking data Riff's stack-based VM is pretty fast, but gets outclassed by register-based VMs in benchmarks where a lot of values need to be pushed on and popped...
Codegen functions should return some kind of error status to the parser so the parser can report info such as the line number the error occured.
Depends on: - #49 | Opcode | Operand(s) | Operation | | ------ | ---------- | --------- | | `SETG` | `X` | `globals[K[X]] = SP[-1]` | | `SETL` |...
Most of the expression parsing logic was written during early stages of development. Long overdue for a refactor. - `nud()`/`led()` should return more useful information than some lexical token for...
TODO: Flesh out this description This was actually added a while back in 13d3ee5185c421bdd8e9e9e2731d04067cbdd40b but later reverted in 6e3e92aa32223786cd39a49d1a1687787cb7b7f8 Depends on: - #48 Ref: - https://en.wikipedia.org/wiki/Modular_multiplicative_inverse
There are any number of ways to design a list comprehension syntax, so not really concerned with those details at the moment. Though I'd want it to be delimited by...