MaiaC (WebC) is a C-to-WebAssembly compiler written in JavaScript, targeting a C89 subset. Version 1.2.4 (as of March 2025) is released via npm, with development on GitHub. It parses C source using EBNF-generated parsers, lowers to WAT, emits WAT via templates, and validates/assembles via the MaiaWASM submodule. Supports Node.js >=18 and browser execution. Differentiators: pure JavaScript implementation (no native dependencies), built-in runtime bridges for host environment (e.g., console, Math), and distribution packaging for browser + Node workflows. Release cadence appears irregular; check GitHub for latest.
npm install maiacNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compile a C89 source string to WebAssembly using MaiaC with WAT output. Demonstrates ESM import and basic usage.
Write C89-compliant code: use /* */ comments, declare variables at block start.
Call webc(options) directly without new.
Run node tools/webc.js compiler/examples/test.c --dist instead of node tools/create-dist.js ...
Declare I/O via extern __console__log(char* msg) and similar host bridges.
Avoid using --resolve-system-includes for production; manually inline includes.
Run `npm install maiac` and ensure your script imports from 'maiac' not a relative path.
Call `webc(options)` directly without the `new` keyword.
Move variable declarations to the beginning of blocks.