CLI Commands
Build & Run
| Command | Description |
|---|---|
wyn run app.wyn | Compile and run (TCC, fastest iteration) |
wyn build app.wyn | Compile to binary (clang/gcc) |
wyn build --release app.wyn | Optimized build (clang -O3) |
wyn build --app app.wyn | New in v1.21 - bundle a double-clickable native application |
wyn build --fast app.wyn | Skip optimizations (fastest compile) |
wyn build --debug app.wyn | Keep the generated .c and .out artifacts |
wyn build --app
Produces a bundled application you can double-click, with no terminal window - a .app on macOS:
$ wyn build --app hello.wyn -o Hello
note: no [app] identifier in wyn.toml - using com.wyn.hello. Two apps sharing an
identifier are ONE app to macOS; set your own before shipping.
✓ Built: Hello.app (51KB, 691ms)
double-clickable native app - no terminal windowSet an [app] identifier in wyn.toml before you ship: macOS treats two bundles sharing one identifier as the same application.
Cross-Compilation
wyn cross <target> app.wynTargets: linux, linux-x64, linux-arm64, macos, macos-x64, macos-arm64, windows, windows-x64, ios, android
WebAssembly is not currently usable. wyn build --wasm does not work in any argument order (the flag is parsed as a path), wasm is not listed by wyn cross's own help, and wyn cross wasm additionally requires Emscripten. The runtime still has POSIX dependencies that need #ifdef guards - see known limitations. An earlier version of this page listed both as working; they do not.
Mobile
| Command | Description |
|---|---|
wyn cross ios app.wyn | Cross-compile an arm64 iOS binary (needs Xcode's iOS SDK) |
wyn cross android app.wyn | Cross-compile an arm64 Android binary (needs the Android NDK) |
The output is a bare device-architecture executable. Packaging to an installable .app/.apk is on the roadmap - see the mobile guide.
Development
| Command | Description |
|---|---|
wyn new <name> | Scaffold a project (--template cli|api|web|lib) with wyn.toml, src/, tests, CI |
wyn test | Run tests in tests/ directory (cross-platform, no shell) |
wyn test tests/expect | Run tests in a specific directory |
wyn test <name> | Run only tests whose name matches |
wyn fmt app.wyn | Format source code (4-space indent, no semicolons) |
wyn fmt src/ --check | Check formatting without modifying (for CI) |
wyn doc app.wyn | Generate documentation |
wyn lsp | Start language server |
wyn debug app.wyn | Debug with DWARF + lldb |
wyn watch app.wyn | Watch and auto-rebuild on save |
wyn design [form.json] | New in v1.21 - visual form designer (needs the gui package) |
wyn repl | Interactive REPL |
wyn bench app.wyn | Benchmark with timing |
wyn ui | Interactive command browser |
wyn doctor | Check your setup |
wyn upgrade | Update wyn to the latest release |
Packages
A dependency is a git repo - there is no central registry. Bare names resolve to github.com/wynlang/<name>; publish by pushing a repo and tagging a release.
| Command | Description |
|---|---|
wyn add <name|url>[@ref] | Add a dependency (git repo); --as <name> overrides the import name |
wyn remove <name> | Remove a dependency |
wyn list | List declared dependencies |
wyn restore | Install all deps from wyn.lock / wyn.toml, pinned |
wyn pkg audit | Verify the lockfile against reality - moved tags error, branch pins warn, FFI deps flagged (--offline skips remote checks) |
wyn bind <header.h> | Generate C bindings from a header |
Each command is also available under the wyn pkg prefix (wyn pkg add, wyn pkg install, wyn pkg remove, wyn pkg list). Curated C libraries (m, z, curl, sqlite3) also install via wyn add <name> - see Using Packages.
Syntax Notes
- No semicolons needed
- Bare
return(no value) works in void functions fn main() -> int { ... }or justfn main() { ... }- String interpolation:
"hello ${name}" - Method chaining:
x.transform().format()
See Also
- Installation - install Wyn
- Quick Start - common workflows
- Deploying - deploy Wyn applications