OC-Wasm: WebAssembly Meets Minecraft
Minecraft modding has always pushed boundaries, but few add-ons are as technically ambitious as OC-Wasm. This project introduces a brand-new CPU architecture for the popular OpenComputers mod, allowing your in-game computers to execute WebAssembly binaries. Suddenly, the sandbox game becomes a playground for systems programmers, embedded developers, and anyone curious about running code written in Rust, Zig, or C directly on a virtual 64-bit processor inside a blocky world. Whether you want to automate a factory, experiment with low-level computing, or just see what WebAssembly can do, OC-Wasm opens a door to a fascinating intersection of gaming and real-world software development.
What Exactly Is OC-Wasm?
OC-Wasm is not a standalone mod; it is an add-on that extends the OpenComputers mod with a new CPU architecture. Instead of writing Lua scripts, you can compile programs to WebAssembly and run them on the same virtual hardware. The add-on does not introduce any new blocks or items. You use the standard OpenComputers computer cases, CPUs, RAM, and EEPROMs, then switch the CPU’s architecture to WebAssembly via a simple shift-right-click. Once set, the computer expects a WebAssembly binary as its BIOS or boot program, unlocking a world of possibilities for high-performance, multi-language development inside Minecraft.
Getting Started with OC-Wasm
Setting up your first WebAssembly computer is straightforward if you are already familiar with OpenComputers. The process mirrors building a standard Lua computer, with a few extra steps to flash the BIOS and load your compiled .wasm files.
Building the Hardware
Start by assembling a basic OpenComputers computer: a case, a compatible CPU (or APU), some RAM, a hard drive or floppy disk, and an EEPROM. OC-Wasm works with existing OpenComputers items, so there is no need to hunt for special components. Once the CPU is crafted, hold it in your hand and shift-right-click to cycle through the available architectures. You will see “WebAssembly” appear alongside the usual Lua 5.2 and Lua 5.3 options. Select it, and your computer is ready to run Wasm code.
Flashing the BIOS
Every OpenComputers computer needs a BIOS, and a WebAssembly machine is no exception. For tiny programs under 4 KiB, you can place your compiled .wasm file directly onto an EEPROM and use it as the BIOS. Most real-world applications, however, will exceed that limit. The solution is OC-Wasm-BIOS, a dedicated bootloader that loads a file named init.wasm from the root directory of an attached disk. To get this BIOS onto an EEPROM, you will need a working Lua computer. Use the Lua machine to download the packed BIOS from the official GitLab repository (search for the OC-Wasm project artifacts) and flash it onto the EEPROM with the flash command. A typical one-liner in the Lua shell handles both steps: wget [repository URL] -O bios.wasm && flash bios.wasm. Once flashed, insert the EEPROM into your WebAssembly computer and it will boot, looking for init.wasm on the disk.
Loading Your Application
With the BIOS ready, you need to place your compiled WebAssembly program on a disk as init.wasm. There are two practical methods. The first is to upload your .wasm file to a web server, then use a working Lua computer to download it with wget onto a disk, and finally move that disk to your OC-Wasm machine. The second method is to directly copy the file into the appropriate Minecraft save directory if you have access to the server files. For frequent development, it is recommended to set bufferChanges=false in the OpenComputers filesystem config to avoid caching issues. Once the disk is in place, power on the computer and your WebAssembly program will start executing.
If you are using the foxygame.net launcher, OC-Wasm can be added to your modpack with a single click from the built-in add-on catalog. The launcher automatically resolves dependencies and keeps OC-Wasm updated, so you can skip manual file management and jump straight into coding your Wasm applications.
Programming Languages and Libraries
OC-Wasm’s true power lies in its ability to run code written in languages that compile to WebAssembly. The community has already built rich ecosystems for Rust and Zig, with more support on the horizon.
Rust Development
Rust developers have a comprehensive set of crates to make OC-Wasm programming ergonomic and safe:
- OC-Wasm-Cassette – Provides an easy async runtime, allowing you to write your main function as an async fn.
- OC-Wasm-Sys – Raw FFI bindings to the OC-Wasm system calls. Most users will not interact with this directly.
- OC-Wasm-Safe – Memory-safe wrappers around the raw bindings, handling opaque value descriptors and ensuring mutual exclusion for non-reentrant system calls.
- OC-Wasm-Futures – Async futures that integrate with Rust’s async/await syntax for clean, non-blocking code.
- OC-Wasm-OpenComputers – High-level wrappers for standard OpenComputers component APIs like redstone, filesystem, and GPU.
- OC-Wasm-Immersive – High-level wrappers for Immersive Engineering and Immersive Technology machine APIs.
While OC-Wasm-OpenComputers is still growing, community merge requests are actively welcomed. If you want to control a mod’s devices through an adapter block, you can contribute new crates or expand existing ones.
Zig and Other Languages
AmandaC from the OpenComputers community has started a Zig library with small examples, making it possible to write OC-Wasm programs in Zig. Because WebAssembly is a universal target, any language with a Wasm backend—C, C++, Go, AssemblyScript—can theoretically be used. The OC-Wasm Javadoc provides detailed technical documentation for those who want to build support libraries for new languages or understand the low-level system call interface.
Compatibility and Version Support
OC-Wasm is designed for modern Minecraft versions running OpenComputers on Forge. The primary development targets Minecraft 1.12.2 and newer, aligning with the most popular modded environments. A community member, DCNick3, has also created a port for Minecraft 1.7.10, extending support to legacy modpacks. If you encounter issues with the 1.7.10 port, report them to that specific fork rather than the main project. The add-on integrates seamlessly with standard OpenComputers components and does not require any extra mods beyond OpenComputers itself. For those who prefer a streamlined experience, the foxygame.net launcher’s version-aware add-on catalog ensures that OC-Wasm is always matched with the correct Forge and OpenComputers builds, eliminating compatibility guesswork.
Why Choose OC-Wasm?
OC-Wasm transforms OpenComputers from a Lua-exclusive environment into a polyglot computing platform. You gain access to mature toolchains, strong type systems, and the performance characteristics of compiled languages. This is ideal for complex automation scripts, real-time control systems, or simply learning how WebAssembly works in a fun, visual context. The add-on is open-source, actively maintained, and backed by a community that values both creativity and technical depth. Whether you are a seasoned modder or a programmer looking for a unique challenge, downloading OC-Wasm for Minecraft is your ticket to a new dimension of in-game engineering.