Create a project
wax new creates the source and build settings for a working Wax application.
Choose an application shape
wax new my-wax-app
The command asks how the application will run:
- One shot calls
Mainonce and exits. - Standalone runs
Initialize,Update, andTeardownin a 60 fps loop. - Embedded exposes an API to a native or WebAssembly host.
One shot is the default. Embedded projects also ask where they will run and which host language bindings to generate.
Create a project without prompts
Pass the same choices as options and add --yes:
wax new my-command --runtime oneshot --yes
wax new my-loop --runtime standalone --yes
wax new my-library --runtime embedded --delivery native --bindings c,python --yes
wax new my-web-module --runtime embedded --delivery wasm --bindings js,typescript --yes
Native embedding supports C, C++, C#, Java, Python, Rust, and Swift. WebAssembly
supports JavaScript and TypeScript. --output changes the artifact directory;
it must remain inside the project.
Delivery chooses the host artifact format, not the compiler backend. Native
delivery creates a host library and records backend: "auto", so Wax can choose
the backend for each build tier. WebAssembly delivery creates a .wasm module
and records backend: "wasm".
What gets created
my-wax-app/
Src/App.wax
.gitignore
README.md
wax.json
wax.json records the runtime, backend, bindings, and output directory. One
shot and standalone projects therefore need no build flags:
cd my-wax-app
wax check
wax run
wax build
Embedded projects use wax check and wax build; their native library or
WebAssembly module runs inside a host rather than through wax run.
Artifacts are written to Generated/ by default. One shot and standalone
projects produce a lowercase executable name, with punctuation replaced by
underscores. Run this project on macOS or Linux with:
./Generated/my_wax_app
On Windows, run:
.\Generated\my_wax_app.exe
An embedded project with native delivery produces a host library. One with
WebAssembly delivery produces a .wasm module. Either form also writes the
requested host binding files to Generated/.
Compiler options remain available for a temporary override. For projects with several output shapes, define named build targets.
Start from an example
wax new warehouse --example warehouse
cd warehouse
wax run --record first-run.wxs
Named examples skip confirmation. The warehouse example is a standalone app
whose state can be recorded and replayed with waxdbg.
The terminal draws the warehouse floor as the robot makes its delivery. Native Release runs need no separate C compiler or Node on macOS ARM64, Linux x64/ARM64, and Windows x64. See Your first investigation to explain the detour and compare a changed route.