WasmCoffee needs JavaScript and WebAssembly (Wasm-GC) to compile and run programs. Please enable JavaScript in a modern browser.
WasmCoffee v0.0.7 Wasm-GC
Java Source Program.java
Stage & Output Idle

WasmCoffee: In-Browser WebAssembly Compiler with Java-Inspired Syntax

WasmCoffee compiles code written with Java-inspired syntax directly to WebAssembly (Wasm-GC) entirely inside your browser, then executes the freshly compiled wasm on the same page. Write code using familiar Java syntax and compile it to WebAssembly with no backend server, no JVM or JDK to install, and no remote compilation queue. The compiler itself is an independent WebAssembly module written in the Odin programming language and compiled to js_wasm32.

Write code in the editor above using Java-inspired syntax, click Run, and your program compiles off-thread in a dedicated Web Worker and runs instantly in WebAssembly with console output, HTML5 2D Canvas rendering, and event callbacks.

What You Can Do

How It Works

When you click Run, the IDE sends your source code to a dedicated Web Worker hosting wasmcoffee.wasm. The worker writes the source text into the compiler's linear memory buffer and executes the compiler pipeline — lexing, parsing, semantic analysis, type checking, and WebAssembly GC emission.

Upon completion, the compiled .wasm bytes are transferred back to the main thread and instantiated via WebAssembly.instantiate() with two import namespaces:

Compile directly to WebAssembly in the Browser — No Server, No JVM

Most online code runners send your source code to a remote container, compile it using a cloud JDK, and stream the console stdout back over WebSockets. WasmCoffee does the opposite: it is a true client-side compiler.

Your source code is never transmitted across the network, ensuring total privacy and zero latency. The entire compiler weighs under 10 MB and runs in your browser without sending your code to a server. Whether you are experimenting with algorithms, testing class hierarchies, or building 2D animations, you get instant compilation feedback with zero configuration.

Language Features & Java-Inspired Syntax

WasmCoffee accepts a practical object-oriented language using Java-inspired syntax:

Learn Java with JavaK

Looking for a comprehensive, beginner-to-advanced Java learning resource? Explore JavaK (javak.co.za), an open Java course covering fundamental programming concepts, syntax, object-oriented design, algorithms, and data structures.

Built-In Examples

Select any example from the dropdown in the toolbar to explore different capabilities:

Frequently Asked Questions

Does my code leave my browser?

No. WasmCoffee is an entirely client-side environment. Source code is written directly into the WebAssembly compiler memory inside your browser and compiled in a Web Worker. Nothing is ever sent to a remote server.

What browsers support Wasm-GC?

Wasm-GC (WebAssembly Garbage Collection) is natively supported by modern browsers: Google Chrome 119+, Mozilla Firefox 120+, Microsoft Edge 119+, and Apple Safari 18.2+.

Do I need a JVM or JDK installed?

No. Neither an Oracle JDK nor a JVM is required on your machine. The compiler is an independent clean-room toolchain built from scratch and compiled from Odin to WebAssembly, running directly on your browser's native WebAssembly virtual machine without any proprietary runtime components.

How fast is compilation?

Compilation is fast. The bundled examples finish in under 20 milliseconds, and even a ~250 KiB source file compiles in well under 100 milliseconds — a pretty fast compile-and-run loop.

Can I build games and 2D animations?

Yes! The built-in Web bridge provides direct access to HTML5 2D Canvas contexts (shapes, paths, text, fills, strokes) and 60 FPS frame updates via Web.requestFrame().

About the Developer

I'm Ewald Horn, a software developer: I build all kinds of things, not just compilers. WasmCoffee is one example from a personal collection of small browser projects used to explore systems programming, WebAssembly, and simulation from first principles. I might be available for freelance development work.

You Might Also Like: WasmPascal

If you enjoy in-browser compilation and classic programming languages, check out WasmPascal (wasmpascal.com). WasmPascal compiles modern and Turbo Pascal source code directly to WebAssembly entirely inside your browser. With zero installation and no server backend, it features an interactive editor, retro text-mode CRT console simulation, HTML5 2D Canvas rendering, and playable arcade games running at full speed on modern web standards.

Acknowledgements & Credits

WasmCoffee is built with gratitude on open-source foundations:

Trademark & Non-Affiliation Notice

Java is a trademark or registered trademark of Oracle Corporation and/or its affiliates in the United States and other countries.

WasmCoffee is an independent educational and developer project created by Ewald Horn. It is not affiliated with, sponsored by, endorsed by, certified by, or associated with Oracle Corporation.

WasmCoffee provides an in-browser compiler for code written with Java-inspired syntax, emitting standard WebAssembly (Wasm-GC). WasmCoffee does not contain, use, reproduce, or distribute any proprietary Oracle source code, binaries, libraries, Java Virtual Machine (JVM) implementations, or intellectual property of Oracle Corporation or any third party.

License & Terms

WasmCoffee is freeware provided free of charge under the WasmCoffee End-User License Agreement (EULA).

WasmCoffee — End-User License Agreement (Summary)

WasmCoffee is provided free of charge for lawful personal, educational, and commercial use. All rights are reserved by the author (Ewald Horn). You may not misrepresent the origin of the software or claim authorship of the compiler, IDE, or runtime bridges.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. For full terms, conditions, restrictions, and governing law, see the complete LICENSE / EULA document.