01. What Frothy Is
Frothy is easiest to learn if you start with three laws from the accepted language spec:
- The top level is a board of stable named slots.
- Code only does a small number of things: read, bind, set, call, choose, and repeat.
- Persistence remembers the overlay image, not the current execution.
That is the center of the language. Frothy is not organized around a user-visible stack. It is organized around values, places, and a live image you can inspect and recover.
A Tiny Example
unit is 75
to pulse with pin [
gpio.high: pin;
ms: unit;
gpio.low: pin
]
to blink with pin [
repeat 3 [
pulse: pin;
ms: unit
]
]
blink: LED_BUILTIN
Read that as ordinary named code:
unitis a top-level slotpulseandblinkare top-levelCodevaluesrepeatis a loop expressiongpio.highandmsare base-image board bindings
If you redefine blink, old callers see the new definition because they still
resolve through the same stable top-level slot.
What Changed From Froth
Frothy keeps the best substrate ideas from Froth:
- live interaction on the device
- coherent redefinition
- persistence and recovery
- transparent inspection
But it deliberately drops the old stack-centric public model. In Frothy, values are read by name, locals are lexical, and code is just another value.
The First Things To Keep In Your Head
name is exprcreates or rebinds a stable top-level slot.to name [...]is just sugar for binding aCodevalue.fn [...]creates anonymousCode.save,restore, anddangerous.wipeoperate on the overlay image.- The device is the real environment. Host tools help you get there faster.
Next: Values, names, and rebinding .