An experimental programming environment
Start with a value.
Before programs and pictures, a few things you can change.
In Progred, you edit the structure of a document directly. These small examples are live editors, not screenshots. Try a change, undo it, or start over—there’s nothing here to break.
Try the first example01 / Values
Change what’s there.
A record holds a few labeled values. This one has a greeting and a count. Each value has its own little editor.
- Not yet completed: Click inside Hello, world! and change the greeting.
- Not yet completed: Change the count from 3 to another number.
0 of 2 steps complete
The braces and labels stay in place. You’re editing a value, not a line of source text.
Ctrl + Z to undo.
02 / Lists
Make room for something new.
A list keeps values in order. You can edit its items, or change the list itself.
- Not yet completed: Click a comma to open a space between two items.
- Not yet completed: Type
"peaches", including the quotes, then press Enter to insert it. - Not yet completed: Click a square bracket to select the whole list.
- Not yet completed: Click inside an item and erase its text with Backspace. One more Backspace removes the empty item from the list.
- Not yet completed: Press Ctrl + Z to undo the removal and bring the item back.
0 of 5 steps complete
You don’t have to balance brackets or repair commas. The list is already a list.
Reset affects only this example.
03 / Cells
One value, in two places.
These aren’t two separate copies of 7. Both pairs of parentheses refer to the same cell. A cell holds a value; changing it changes what you see everywhere it’s referenced.
- Not yet completed: Change either 7. Watch the other one change too.
- Not yet completed: Click a comma and type
(to create a new cell. Click the empty box inside it, type 11, then press Enter. - Not yet completed: Click another comma to open a space. Hold Ctrl and click a parenthesis around your new cell—not the number—to put another reference there.
- Not yet completed: Change either 11. Its new partner changes too; the original pair stays separate.
0 of 4 steps complete
Cells can hold lists, records, or any other value—not just numbers. The parentheses select the reference; the inside edits its contents.
Ctrl-click picks a reference into an open space, including on a Mac.
04 / Grap
Let a value do some work.
Grap is a programming language built from these same structures.
Here, each expression before an arrow is evaluated; its result
appears after the arrow. * means multiply.
The three parenthesized 3s refer to one cell: on its own, in an addition, and in a multiplication.
- Not yet completed: Change the 2 after + to 4. The sum becomes 7; the multiplication stays at 6.
- Not yet completed: Change any parenthesized 3 to 5. All three references update. After the first step, the results become 9 and 10.
0 of 2 steps complete
Results are read-only; change the numbers in the expressions to change them.
Select a number’s digits to replace them. Ctrl + Z to undo.
05 / Functions
One recipe, different inputs.
The first line defines scale: it takes a parameter called x and multiplies it by 2. The next two lines call that function with different numbers and show their results.
Unlike the shared number in the previous example, x gets its value separately for each call.
- Not yet completed: Change the first call’s 3 to 4. Its result becomes 8; the other stays at 10.
- Not yet completed: In the function definition, change the multiplier 2 to 3. After the first step, both results update to 12 and 15.
- Not yet completed: Click x inside the definition’s parameter list and rename it to amount. Its uses and the call labels change too; the results stay the same.
0 of 3 steps complete
Names make references readable. Renaming a parameter doesn’t break its connections: they use the cell’s identity, not its spelling.
Select the digits or name to replace them. Ctrl + Z to undo.
A small beginning
From programs to pictures.
Drawings and interactive views build on these same structures. Those are the next steps in this introduction. For now, try the editing—and see what feels natural, or what gets in your way.
Explore the full editorSteps check off as you complete them, and stay checked while you experiment or undo. Reset starts that example over, including its checklist. Edits and progress are lost on reload. The browser editor currently uses Ctrl shortcuts, including on a Mac.