Back to mods
OC-Wasm project artwork

CurseForge · Minecraft mod

OC-Wasm

An OpenComputers architecture that runs WebAssembly

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which OC-Wasm release should I use?

Updated 2 years ago
Latest stable file oc-wasm-1.12-1.0.0.jar
Game version 1.12.2
Loader Forge

oc-wasm-1.12-1.0.0.jar targets 1.12.2 with Forge. The project page does not say whether this file belongs on the client, dedicated server, or both. No extra mods listed for this file.

Where it goes

Is OC-Wasm required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release Forge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does oc-wasm-1.12-1.0.0.jar need?

oc-wasm-1.12-1.0.0.jar. Change the file and its required mods may change too.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add OC-Wasm without breaking your instance.

Built for oc-wasm-1.12-1.0.0.jar. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use oc-wasm-1.12-1.0.0.jar. It targets 1.12.2 with Forge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside oc-wasm-1.12-1.0.0.jar. It opens that exact file at the source.

About this project

What does OC-Wasm add?

Overview

OC-Wasm is a CPU architecture for OpenComputers which executes WebAssembly binaries.

Getting Started

To get a basic “hello world”-type application running with OC-Wasm, you’ll need to follow a few steps:

  • Build a computer. OC-Wasm doesn’t add any new items; instead, you use the standard OpenComputers items, just as if you were building a Lua computer. After crafting the CPU or APU, hold it in your hand and Shift-Right-Click to switch architectures—just like you would to switch between Lua 5.2 and 5.3—and you should see WebAssembly in the list.
  • All computers need a BIOS, and WebAssembly computers are no different. If your program is very small (≤4 kiB), you can put it directly on an EEPROM and use it as a BIOS directly. Usually, though, your program will be too big to fit on an EEPROM, so you’ll want a BIOS which can load your program from disk. OC-Wasm-BIOS does just that: it loads a program from /init.wasm on a disk (just like the Lua BIOS loads a program from /init.lua). Since there’s no craftable item that comes with a BIOS, you’ll need to download the BIOS onto an existing computer (presumably running Lua, e.g. via wget) and flash it onto an EEPROM (e.g. via flash). Here’s a one-liner that does that: wget https://gitlab.com/api/v4/projects/27476164/jobs/artifacts/main/raw/packed.wasm?job=Compile -O bios.wasm && flash bios.wasm OC-Wasm-BIOS
  • Create your application. You’ll probably do this outside Minecraft, using regular software development tools. Once you’ve compiled a .wasm file, name it init.wasm and place it in the root directory of a hard drive or floppy disk. This can be done a few different ways:
    • Upload your program to the Internet, put the disk in a working computer, download the file to it with wget, and move the disk to the new computer.
    • Place the file directly in the proper place in your Minecraft save game directory, if you have access to it. You probably want to set bufferChanges to false in the filesystem section of your OpenComputers config file if you’re regularly using this method.
  • Boot your computer!

Working in Rust

A number of crates are available to make writing OC-Wasm programs in Rust ergonomic:

  • OC-Wasm-Cassette provides an easy way to use the Cassette async executor to run an async fn as your main function.
  • OC-Wasm-Sys is a set of raw FFI bindings. You probably don’t want to use this crate directly, but it underpins all the other ones.
  • OC-Wasm-Safe is a set of wrappers around OC-Wasm-Sys that provide memory safety, safe handling of opaque value descriptors, and mutual exclusion over system calls that cannot be invoked multiple times simultaneously.
  • OC-Wasm-Futures is a set of async futures that make it easier to write an OC-Wasm program using async and await.
  • OC-Wasm-OpenComputers is a set of high-level wrappers around the component APIs supported by ordinary OpenComputers (such as the redstone API, the filesystem API, the GPU API, etc.).
  • OC-Wasm-Immersive is a set of high-level wrappers around the component APIs supported by Immersive Engineering and Immersive Technology machines.

As of this writing, OC-Wasm-OpenComputers is incomplete, and there are few crates for high-level wrappers around other mods that can interact with OpenComputers (e.g. via the adapter block); however, community contributions (in the form of merge requests to OC-Wasm-OpenComputers or new crates for content from mods) are very welcome!

Working in Zig

AmandaC from the OpenComputers community has started early work on a repository with a Zig library and a few small examples for OC-Wasm.

Other Versions

DCNick3 made a port of OC-Wasm to Minecraft 1.7.10. If you run into any problems with it, please report them there, not here.

Technical Details

If you want to work in a language which doesn’t already have support libraries, or you’re just curious how things work under the hood, please have a look at the OC-Wasm Javadoc.

Project description from CurseForge.

Pick your setup

OC-Wasm by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

2 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

OC-Wasm versions and loaders

6 of 6 releases match

Looking for an older file? The official CurseForge project page is in Resources.