Three example Raven programs:
malloc.rv
, which is the memory allocator currently used in Raven's standard library and invoked by the compiler where needed.- It may well be the worst allocator ever written, but it gives an idea of what low-level pointer-programming looks like (bearing in mind this is not the language's design priority).
complex.rv
is also taken from the standard library and shows how you can define a new numeric type and various operations on it, using dispatch and pattern matching.- There's no
Number
type or any other abstract traits yet, interfaces are still informal, though tools for formal interfaces are planned.
- There's no
brainfuck.rv
is the most complete and realistic program to date, showing parsing to a recursive AST and the core interpreter loop.- In future I expect programs to mostly look a bit more Python- or Clojure-like, centred around generic dictionaries and lists rather than custom types, but those data structures don't yet exist. This gives an unfinished bu