Officina
The workshop
A notebook that runs in your browser. Add code and prose cells, pick a language, and start from one of 129 worked examples. Nothing is uploaded anywhere — there is no server behind this page, so the code and any file you open stay on your machine.
129 examples · 5 languages · Python, C, C++ and Java run here
What this is, and what it is not
Python runs here for real. The interpreter is CPython compiled to WebAssembly — the whole standard library, arbitrary-precision integers, exceptions and all — fetched the first time you press Run and cached by the browser after that. It is 12.9 MB, which is why it is not fetched until you ask for it.
C and C++ are compiled, not interpreted and not sent anywhere. Pressing Run hands your cell to clang, links the object with wasm-ld and executes the module it produces — the same three steps you would run at a terminal, with the same compiler, reporting the same errors down to the line and column. The toolchain is heavier than Python's, so it arrives in pieces on your first Run and is cached from then on.
Java is compiled here too, by the Eclipse batch compiler, and run on a JVM built to WebAssembly by CheerpJ. It is the single exception to a rule this site otherwise keeps absolutely — that nothing loads from anywhere else — because CheerpJ's free licence allows its runtime to be served only from the vendor's own domain. The alternative was no Java, and this seemed the better trade.
Assembly does not run here, and I would rather say so than give you a button that fails: it is written for a processor the browser is not, and there is no assembler on this page to make it one. It gets the editor, the examples and a download with the exact command to build it.
Nothing here reaches a server. There is none: the site is static files, your cells are saved in this browser's local storage, and a file you open is read by the page rather than uploaded. Close the tab and the work is still here; clear your browser data and it is gone.