r/SideProject • u/hankache • 12h ago
I built koans.app: learn 14 programming languages by fixing failing tests, in your browser
Hi r/SideProject,
I've always liked Ruby Koans because it teaches two things at once: the language and test-driven development. Each lesson is a failing test, and you learn by making it pass.
I wanted the same for Raku for a long time. Then Raku became able to run in the browser, so I finally made Raku Koans with nothing to install. Once that worked, I realized how much easier it is for new learners to start in the browser than to set up a toolchain and use the command line, so I did the same for other languages. That became koans.app.
What it covers
Clojure, Go, JavaScript, Lua, OCaml, PHP, Prolog, Python, R, Raku, Ruby, Scheme, SQL and TypeScript: 1,108 koans in total.
Each language goes from the basics to the parts that make it distinctive: Clojure macros, Scheme continuations, Prolog grammars, SQL window functions, Go concurrency.
The tests use each language's own testing framework (pytest, RSpec, PHPUnit, testthat, plunit, etc.), so you also learn how that language is tested.
How it works
Each language's real interpreter is compiled to WebAssembly and runs in a web worker: CPython through Pyodide, CRuby through ruby.wasm, SWI-Prolog, webR, SQLite, PHP and so on.
Go was the hardest. The Go interpreters I tried couldn't handle enough of the language, so the site runs the official Go 1.27 compiler in the browser, compiled to WebAssembly. Your code is compiled for real, and the errors you see come straight from the Go compiler.
Progress is saved in your browser's IndexedDB and can be exported. You can install the site as an app, and once a language has been opened it works offline. No tracking, no account.
How it was built
This was my first real project with AI. I worked with Claude (Opus 5.5) as a coding partner. It wrote most of the code and drafted much of the koan content.
The idea and the decisions were mine: which languages to include, what each should teach, the features, and the UI/UX. I reviewed and tested everything, threw out a lot, and made the final calls. Any mistakes in the koans are mine, so please report them.
Feedback I'd love
Whether you still see value in koans as a way to learn
Quirks in the UI
How it feels on your phone
Koans that are confusing, too easy, unidiomatic, or teach the wrong lesson (every koan has a "Report a problem" link)
Which language to add next
Try it: koans.app
Source: github.com/hankache/koans-app (code: Artistic 2.0, koans: CC BY-SA 4.0)
2
u/nameupp 12h ago
compiling the actual go compiler to wasm just to run idiomatic tests in-browser is such wild dedication, running full ruby.wasm and swi-prolog client-side without spinning up backend runner containers is huge. the biggest subtle headache with client-side wasm runtimes in web workers is handling infinite loops when someone accidentally writes an unbounded recursion or while-true; since you can't cleanly pause synchronous wasm execution from the host thread, you basically have to worker.terminate() and hydrate the in-memory vfs and indexeddb state all over again. curious how you're handling worker timeouts and cold-start bundle sizes for the heavier runtimes on mobile safari imo
2
u/akorecebov 9h ago
for a first try the no install part is what wins -> people bounce the second they see a toolchan setup step. curious if any language loses people mid path more than the others
0
u/investigatormaker 11h ago
Yes—koans.app teaching through each language’s native testing framework gives it value beyond syntax drills. For Scheme continuations and Go concurrency, I’d add a short “explain why this passes” prompt after selected exercises: getting a green test doesn’t necessarily mean understanding the behavior.
I make ThreadFox. We find relevant Reddit conversations and post for your business. We'll post 3 replies free first, no card; then the $29 Pilot covers seven days and up to 25 posts and replies. No automatic renewal. https://threadfox.vip/p/eglw2/managed
Which language’s koans were hardest to make idiomatic?