Live demo
This page runs paludarium in your browser. When you press Run, the page builds a tiny static x86-64 Linux program that prints your message with the write system call and ends with exit_group, and paludarium runs it in WebAssembly.
What happens
- The page assembles an ELF executable of about 200 bytes in JavaScript: one loadable segment with eight instructions and your message (
hello-elf.ts). - It loads
@aletheia-works/paludarium-wasmand callsrun()with the program in a private in-memory filesystem. - paludarium decodes and runs the x86-64 instructions, handles the two system calls, and returns standard output and the exit status as Web Streams and a promise.
The same package runs real programs such as statically linked C and Rust binaries; see JavaScript and the browser.
Cross-origin isolation
paludarium uses SharedArrayBuffer, which browsers allow only on cross-origin isolated pages. GitHub Pages cannot send the needed headers, so this site registers coi-serviceworker to add them. On the first visit the page reloads once.