Programming is done by dragging things from the Panel(left) into the Rules(middle) or Bag(right). Step through the evaluation by pressing the button with the squiggly symbol(bottom right) to rewrite the symbols in the Bag.
Tote is a multiset rewriting language.
Riffing on Le Guin's Carrier Bag Theory of Fiction, this presents a primordial vision of computation in which programs are written as a list of changes in the content of a bag, and programming can be done entirely with a touch interface and without the need for textual representations.
To learn more, see the examples from Pocket Rewriting, and Fractran.
Introduction
During evaluation, rules are tested in a sequence from the first to the last, when the bag contains a rule's left-side, the symbols are replaced by those in the right-side, and search for the next rule starts back again from the beginning.
Subtract Program | |
---|---|
:: x y sub > sub :: x sub > pos sub :: y sub > neg sub :: sub > |
Once the rules have been created, add things to the Bag by dragging them from the Panel. To get the result of 8-3, add 8 times the first symbol(triangle), 3 times the second(lozenge), and the subtract symbol(empty dot). Step through the evaluation by pressing the squiggly symbol until transformations are no longer possible.
Content of Bag | |
---|---|
x=8 y=3 sub | pos=5 |
Loops
Here's a little fizzbuzz program that demonstrates how to create loops and conditionals. Notice how the order of rules will erase the fizz/buzz tokens before incrementing the counters.
The program above is roughly equivalent to the following bit of pseudocode:
while(x++ || y++) { if(x == 3) print_fizz(), x = 0; if(y == 5) print_buzz(), y = 0; }
Setting Anchors
Clicking inside the bag during symbol editing gives that symbol an anchor position, when that symbol will be created as the result of a rule, it will spawn at that location.
To open the Symbol Editor, click on the symbols in the Panel(left), this menu allows to draw new symbols, save/load the symbols, lock/unlock the dragging of the symbol in the bag, activate continuous/step mode for when the symbol is clicked on.
Click on a rule's arrow to toggle between one of four triggers that can trigger the rule:
- --> On step
- >-- On clicking on a symbol
- -<> On dragging a symbol onto another
- ..> On a timer
- watch examples, playlist by CapitalEx
- view source
- download rom
- Community, Discord
- Original characters by Rek Bellum
incoming pocket rewriting