Vora language runtime compiled to WebAssembly — run .va scripts in the browser.
Powered by Emscripten, embeds the full Vora VM pipeline: lexer → parser → compiler → bytecode interpreter.
- Emscripten (
emccin PATH)
# Activate Emscripten
source /path/to/emsdk/emsdk_env.sh # Linux/macOS
# or: emsdk activate
# Configure + build
cd Vora-WASM
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
# Output:
# build/vora_wasm.js (Emscripten glue)
# build/vora_wasm.wasm (WASM binary)# Serve the www/ directory (any HTTP server works)
python -m http.server 8000 -d www
# or: npx serve www
# Open http://localhost:8000 in a browserCopy build/vora_wasm.js and build/vora_wasm.wasm into www/ first, or adjust the script path in index.html.
import VoraWasm from './vora.js';
await VoraWasm.init('./vora_wasm.js');
const { ok, output, error } = VoraWasm.run('print("hello")');
// → { ok: true, output: "hello\n" }Load the Emscripten WASM module. Must be called once before run().
Execute Vora source code. Returns:
{ ok: true, output: "..." }— success, with captured stdout{ ok: false, error: "..." }— parse error, compile error, or runtime error
Vora-WASM/
├── src/
│ └── vora_wasm.cpp # C bridge: vora_run() entry point
├── www/
│ ├── index.html # Browser playground
│ └── vora.js # JS wrapper API
├── CMakeLists.txt # Emscripten build
├── LICENSE
└── README.md
JS (browser)
│ vora.js
│ VoraWasm.run(source)
▼
C bridge (vora_wasm.cpp)
│ vora_run(const char* src)
│ ├─ Capture stdout/cerr → ostringstream
│ ├─ Lexer → Parser → Compiler → VM
│ └─ Return JSON: {ok, output?, error?}
▼
Vora core (lexer, parser, compiler, VM)
| Feature | Status |
|---|---|
Single-shot execution (vora_run) |
✅ |
| Browser playground | ✅ |
import / stdlib |
🔜 P1 |
| REPL / incremental execution | 🔜 |
| Vora ↔ JS bidirectional calls | 🔜 |
MIT — see the main Vora repository.