Skip to content
reobf edited this page Apr 12, 2026 · 18 revisions

Setup Emscripten SDK

If you use Windows, just download the mod with '-win' suffix, it contains prepacked Emscripten SDK for Windows.

First, you should install python3 of version 3.6 or higher.
For Windows users, you can python3 in Microsoft Store.
For linux users, you are likely to have preinstalled python.
You do not have to use pip so using system python3 is okay, just proceed.

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
emsdk install latest
emsdk activate

Problem installing on Windows?
Get one from BaiduNetdisk or GoogleDrive , this one contains pre-installed deps, just run emsdk activate.

Then environment varibles are set, you can:

emcc source.c -o output.wasm
em++ source.cpp -o output.wasm

Then upload this file to OpenComputers DiskDrive root dir and rename it to 'init.wasm'.
Insert a WASM CPU to the Case, it will run the .wasm file from the first DiskDrive that has 'init.wasm' in its root directory.
WASM CPU does not support OS, it's like baremetal.

Host API
Emscripten C Guide
Emscripten CPP Guide
Examples

Clone this wiki locally