Lessons
Forth · Expert
Forth · Expert. Ten lessons. Open-book quizzes. Lesson 1 free.
10 lessons · The Host · Lesson 1 free
Pass all ten lessons for the certificate. Sample · Claim

Lesson 1 · On the house
SAVE-INPUT, RESTORE-INPUT and nested sources
Tell file, string and terminal input apart with source-id, snapshot the input position with save-input, and replay text with restore-input.

Lesson 2
Dual semantics: NAME>COMP, COMPILE-ONLY, INTERPRET/COMPILE:
Read a word's compilation semantics with name>comp, forbid interpretation with compile-only, and give one name separate interpret and compile actions.

Lesson 3
Search-order control: private, sealed and switchable wordlists
Push and pop wordlists with >order and previous, hide helpers in private wordlists, seal a search order, and swap the top wordlist.

Lesson 4
VALUE and DEFER internals: building +TO and DEFERS
Reach the cell behind a value with >body, add the missing +to with interpret/compile:, inspect deferred words with action-of, and chain with defers.

Lesson 5
Exception chains: nested CATCH, ABORT" and cleanup
Create named throw codes with exception, rethrow through nested catch frames, catch abort", and restore state on every exit path.

Lesson 6
REFILL, SOURCE and >IN: parsers that span lines
Read following lines with refill, compare whole lines with source, pull words across line breaks, and finish parsing by moving >in.

Lesson 7
A tiny object system: vtables and DOES> dispatch
Number methods with a defining word, store xts in per-class tables, dispatch through the object's first cell, and inherit by copying a table.

Lesson 8
Classic blocks: BLOCK, BUFFER, UPDATE, LOAD, THRU
Map a blocks file, write 1024-byte blocks through buffers, mark them with update, flush with save-buffers, and interpret them with load and thru.

Lesson 9
A bytecode stack machine in Forth
Assemble bytecode with mnemonic words, dispatch opcodes through an xt table, implement jumps with an instruction pointer, and trap bad opcodes.

Lesson 10
Custom control structures: AHEAD, CS-ROLL, CS-PICK
Work the control-flow stack directly: jump forward with ahead, rebuild WHILE with cs-roll, add a continue with cs-pick, and leave loops through two exits.
Sample certificate
Certificate of completion
Sign in to claim your certificate of completion.
Certificate
Finish all ten lessons, then sign in
Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.