polysyntax

Free, local, test-driven exercises in several programming languages.

Open source Programming exercises
  • Rust
  • axum
  • Nuxt
The polysyntax web UI: a Rust exercise beside its tests, 8 of 11 passing.
  1. The exercise.
  2. The tests that check it.
The hard part

Making learning interactive, on your own machine.

01

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.

02

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.

03

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.

04

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.

05

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.

06

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.

Let’s talk

About a project, or about a role on your team. You’ll hear from me within 24 hours.

— Dimitri, RG Digital

Email me to plan a call A reply within 24 hours · NL or EN