Alongside the AssemblyScript module, NEX OS ships a full Rust WebAssembly engine inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shadownrx/windows/llms.txt
Use this file to discover all available pages before exploring further.
wasm-engine/ that handles operations too complex for AssemblyScript’s constrained type system. Rust brings the full power of a systems programming language to the browser: ownership semantics, zero-cost abstractions, rich trait implementations, and access to the entire Rust crate ecosystem — all compiled down to a compact .wasm binary. Where AssemblyScript is the right tool for simple numeric functions, the Rust engine is deployed wherever the logic demands it.
Directory Structure
The pre-compiled binary committed to the repository at
public/process_utils.wasm is built from the AssemblyScript source (assembly/index.ts) — not from the Rust engine. The asconfig.json targets public/process_utils.wasm as its output and that file ships with a .wasm.map source map consistent with an AssemblyScript build. You only need to compile the Rust engine separately if you modify wasm-engine/src/lib.rs. See the Recompilation section below.What the Rust Engine Powers
The Rust WASM module backs three distinct capabilities inside NEX OS:System Calculations
High-frequency CPU and memory metric calculations for the Task Manager, running at native speed without saturating the JS thread.
C++ Transpiler
The Dev-C++ 2026 application’s
cppEngine.ts utility calls into the Rust WASM module to parse and transpile C++ source code inside the browser.Process Management
Operations over the simulated process table — sorting, filtering, and aggregating process telemetry data for the Task Manager’s process list.
Rust vs. AssemblyScript: Choosing the Right Engine
Both engines compile to WebAssembly and live behind the sameuseWasmEngine hook interface, but they serve different authoring and capability needs.
| Concern | AssemblyScript | Rust |
|---|---|---|
| Syntax | TypeScript-like | Rust (ownership, lifetimes, traits) |
| Learning curve | Low for TypeScript devs | Higher — requires Rust knowledge |
| Type system | Strict numeric types only | Full type system, generics, traits |
| Complex algorithms | Possible but limited | Idiomatic and well-supported |
| Crate ecosystem | None | Full crates.io access |
| Build toolchain | asc (npm script) | wasm-pack or cargo |
| Best for | Simple numeric functions | Complex business logic, parsers, transpilers |
Integration: The cppEngine.ts Bridge
The Dev-C++ 2026 app (src/components/apps/DevCpp2026.tsx) exposes a full in-browser C++ IDE. When a user compiles code, the frontend delegates the parsing and transpilation work to the Rust WASM engine through the cppEngine.ts utility at src/utils/cppEngine.ts.
This utility acts as the bridge between the React component layer and the Rust binary:
- The IDE component calls
cppEngine.tswith the raw C++ source string. cppEngine.tsloads the Rust WASM binary and invokes the exported Rust function.- The Rust function in
lib.rsprocesses the C++ source and returns the result. cppEngine.tspasses the output back to the IDE for display.
Recompilation
The Rust WASM module requires a different toolchain from the AssemblyScript module. You will needwasm-pack installed, or you can use the lower-level cargo command directly.
Option 1: wasm-pack (Recommended)
wasm-pack produces optimized, browser-ready output with JavaScript bindings automatically generated:
Option 2: cargo directly
For more control over the output format, build directly with cargo:
The Pre-Compiled Binary
Thepublic/process_utils.wasm file committed to the repository is a pre-compiled binary built from the AssemblyScript source. It works out of the box — no Rust toolchain required for day-to-day development. It is loaded by the wasmLoader utility at startup:
Both the AssemblyScript and Rust engines can target
public/process_utils.wasm. Running npm run build:as regenerates that file from AssemblyScript. Running wasm-pack build from wasm-engine/ replaces it with the Rust output. The binary committed to the repository is from AssemblyScript — rebuild with wasm-pack from wasm-engine/ to activate the full Rust engine.Project Structure in Context
The Rust engine is one of two WebAssembly layers in the NEX OS codebase. Here is where it fits relative to the full project:Further Reading
WASM Overview
Understand why NEX OS uses WebAssembly, see the performance numbers, and learn about the
useWasmEngine hook.AssemblyScript Module
Write TypeScript-like WASM functions, run the build pipeline, and integrate with React components.