wasm-ide is a browser-based IDE for competitive programming. It compiles and
runs code in a Web Worker, stores workspaces in the browser filesystem, and can
optionally connect to remote evaluation and contest systems.
Download wasm-ide.tar.gz or wasm-ide.zip from the
latest release,
extract it into a directory served by your web server, and adjust config.json
as needed.
The application must be served over HTTPS; opening index.html directly is not
supported. It also requires cross-origin isolation, so every response must
include these headers:
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Compiler archives in the release are Brotli-compressed. Requests for
/compilers/<language>.tar must be served from the corresponding .tar.br
file with Brotli content encoding. For example, an nginx server with the
ngx_brotli module can use:
server {
listen 80;
server_name _;
root /path/to/wasm-ide;
index index.html;
add_header Cross-Origin-Embedder-Policy require-corp always;
add_header Cross-Origin-Opener-Policy same-origin always;
location / {
try_files $uri $uri/ =404;
}
location /compilers/ {
brotli_static on;
}
}Use HTTPS for a public deployment. TLS configuration is omitted from this minimal example.
The frontend loads config.json from the web root at startup. The release
archive includes a ready-to-use configuration; source builds use config.json
when present and otherwise fall back to config.example.json.
The main fields are:
title: an optional window/tab title for the application. Set tonullor omit to preserve the default title.default_ws: initialcodeandstdinfiles for a new local workspace. Each object maps a filename to either a UTF-8 string or an array of bytes.remote_eval: an optional endpoint for a remote evaluation backend. Set it tonullto use only the in-browser backends.contest: an optional contest-system connection. Set it tonullwhen no contest integration is needed.workspace_enabled: whether to show workspace management. It defaults totrue; set it tofalseto use a persistent workspace nameddefaultautomatically. This mode cannot be combined with a contest integration.auto_init_contest_tasks: an optional language name (e.g.,"C++"). When configured with a contest system, wasm-ide automatically queries the contest API at startup and creates non-deletable workspaces for all contest tasks using this language (if not already present).default_locale: the initial interface language. A locale previously selected by the user takes precedence; set this field tonullto use the browser language.default_settings: default values for user settings. It can contain any subset of the settings stored by wasm-ide; omitted values use the built-in defaults. These values are used only when the browser has no saved settings.compilers: the generated map of compiler archive names to their uncompressed sizes. Preserve this field in a precompiled release. Source builds generate it from the archives incompilers/.
Contest configuration is internally tagged. For CMS:
{
"contest": {
"type": "cms",
"endpoint": "https://cms.example"
}
}For Terry, use "type": "terry" with the appropriate endpoint. Only one
contest system can be configured at a time.
By default, wasm-ide compiles and runs C, C++, Python, Rust, and JavaScript
locally in the browser. Additional languages can be made available through a
remote evaluator by setting remote_eval in config.json.
The recommended remote evaluator is eval-server from
olimpiadi-informatica/task-maker-rust.
Remote evaluation does not support streaming input or language-server features.
Install Rust and ensure ~/.cargo/bin is in PATH. The
repository's toolchain file selects stable Rust and the WebAssembly target; then
install Trunk:
rustup target add wasm32-unknown-unknown
cargo install --locked trunkThe build also requires npm, jq, and brotli in PATH.
Download the .tar.br compiler archives from
olimpiadi-informatica/wasm-compilers
and place them in compilers/. With the GitHub CLI installed, this can be done
with:
mkdir -p compilers
gh release download --repo olimpiadi-informatica/wasm-compilers \
--dir compilers --pattern '*.tar.br'Optionally create config.json to override the example configuration, then
build the production bundle:
trunk build --releaseThe complete static application is written to dist/. Serve that directory
with the headers and Brotli handling described above.
Translations are stored as JSON files in
frontend/locales. To add a language:
- Copy
frontend/locales/en.jsonto a file named after the new locale. - Translate the values while preserving every key and placeholder such as
{{score}}. - Add the locale to the
localeslist infrontend/Cargo.toml. - Rebuild the frontend and check the new language in the interface.
Contest integrations live in
frontend/src/contest_api. Start with the module
documentation in
frontend/src/contest_api/mod.rs, which
describes the extension process and the ContestAPI contract.
In short, a new integration needs a protocol-specific module, a
ContestConfig variant, an implementation of the ContestAPI trait, and a
constructor entry in contest_api::init. The existing CMS and Terry modules are
working examples.