polysyntax
Free, local, test-driven exercises in several programming languages.
- The exercise.
- The tests that check it.
Making learning interactive, on your own machine.
The problem
Learning a programming language often means paying for a course. polysyntax is a free alternative: exercises you run on your own machine, checked by tests.
It started as my way to learn Rust. It used to be called polyglot-learn.
Constraints
It runs offline on your own machine, with your own editor: `learn lsp` brings the tests, task and hints into any editor.
Tracks: TypeScript, Python, Rust, Go, PHP, Lua and QML. You install the toolchains for the languages you pick; `learn doctor` lists them.
Prebuilt binaries cover Linux, macOS and Windows on x86-64 and ARM. They aren’t signed yet.
Decisions and why
I wanted to learn several languages and see how they differ when they do the same thing. So every exercise is written once as language-neutral data, a signature plus test cases, and each track generates its own stub and tests from it.
What broke
One exercise for seven languages runs into what they don’t share. QML numbers are JavaScript doubles, so the shared test values have to stay within 2^53, and QML stubs use `real` for integers. A test that hung could also leave processes behind, so a timeout now kills the test’s whole process tree. The shared format only holds where every language can follow it.
What I’d do differently
I’d start with the basics of each language before going deep with exercises. The Syntax Primer, seven reading pages before the first exercise, came later than it should have.
How it was built
AI wrote almost all of it, because I didn’t know most of these languages well enough yet. Rust is the base and runs it all: the CLI, the test runs and the web UI’s server.