Moth is a small programming language with no symbols to learn. You write say, if and
repeat, draw pictures, make games, and when something goes wrong, it tells you in plain words.
$ moth build hello.moth get moth
Everything below runs in the playground underneath, with nothing to install.
if age is at least 18, not if (age >= 18) {. Lists, records and dictionaries are written the way you'd say them.
It points at the exact spot, and guesses what you meant.
line 2: 'totl' has no value yet. Did you mean 'total'?
Keys, clicks and timers. Snake is 110 lines, and runs right here.
A bytecode VM, a JIT to JavaScript, WebAssembly that Moth writes byte by byte, and machine code, written by a compiler in Moth. Thousands of random programs check they say the same.
2,400 lines of Moth that compile any Moth program, itself included, to exactly what the JIT writes, byte for byte. And moth.exe, Moth in machine code, builds itself with no JavaScript at all.
Step through a run in either direction: the line about to run, every variable, and the picture as it was.
0.1 + 0.2 is 0.3, as in a spreadsheet. Numbers can have units: 5 km + 300 m is 5.3 km, and adding a time to a distance is a mistake that says so.
read table "sales.csv", then for each row in sales where ..., total of price in sales and draw chart of price in sales.
On your computer, a program asks before it reads or writes your files or goes online, as Deno does. --allow-read and the rest let it without asking.
Click one to open it in the playground.