Build out environment and map support
Restructure and begin evaluator
Update generated parsers & add nums, math
A parser and interpreter of Rhumb programs. Currently working on an in-process evaluator (Node). Planning to add two compilation targets (QBE & WAT).
Rhumb is an esoteric differential-inheritance dynamic functional programming language.
% Tree Example
EmptyTree .= [
includes .. (x) -> false
insert .. (x) -> ~TreeNode(x)
size .. 0
do .. (sub) -> ~
]
Tree .= () -> (
~@type := EmptyTree
)
TreeNodeTraits .= [
includes .. (x) -> x == ~\contents => true !> (
sub-tree .= x << ~\contents {
true .. ~\left
false .. ~\right
}
sub-tree\includes(x)
)
insert .. (x) -> <(^1(x; ~\contents))> {
_==_ .. ~
_<<_ .. ~\left\insert(x)
~\right\insert(x)
}
size .. <(~\left\size ++ 1 ++ ~\right\size)>
do .. <(~\left\do(^1); ^1(~\contents); ~\right\do(^1); ~)>
_*_ .. (origin) ->
~\left .= origin\*left
~\right .= origin\*right
]
TreeNode .= (contents) -> (
~@type .= TreeNodeTraits
~\left := *Tree
~\right := *Tree
~\contents := contents
)
Translation of an example from Self: The Power of Simplicity
Maps search through inner labels first (\
or __inner__
). Then it reaches into any sub maps (@
or __under__
). It searches all inner labels of each sub map. If multiple labels are found, an error is thrown. If nothing is found, it then begins searching through any sub maps of the current set of sub maps. This process continues until there are no more sub maps available to traverse.
Scopes are searched through the prior labels first. Then it searches the outer scope. It continues going into the next outer scope until there are no more outer scopes to traverse.
Name | Associativity | Operators | |
---|---|---|---|
Map | [] |
||
Selector | {} |
||
Routine | () |
||
Member | Left | \ , @ , ` |
` |
Invocation | x() |
||
Access | x[] |
||
Effect | x{} |
||
Power | Right | ^^ ,^/ , *^ |
|
Prefix | Right | - , ~ , ! , # , ^ , & , * , + , = , @ , ? , . , : |
|
Multiply | Left | ** , // , +/ , -/ , ~~ |
|
Add | Left | ++ , -- , +- |
|
Compare | Left | >> , >= , << , <= |
|
Conjunctive | Left | && |
|
Disjunctive | Left | || |
|
Identity | Left | == , =~ , =\ , =@ , =* , != , !~ , !\ , !@ , !* |
|
Conditional | Right | !! , ?? , <> , |> , => , !> |
|
Applicative | Right | -> , ~> |
|
Assignment | Right | .= , := , .. , :: |
|
Literal | 10,000.1 , "foo" , <ref> , label |
Can run programs directly in Node
Generates QBE assembly which can then be compiled down to an executable
Generates Web Assembly which can then be placed on a website