Skip to content

CLI Commands

Build & Run

CommandDescription
wyn run app.wynCompile and run (TCC, fastest iteration)
wyn build app.wynCompile to binary (clang/gcc)
wyn build --release app.wynOptimized build (clang -O3)
wyn build --app app.wynNew in v1.21 - bundle a double-clickable native application
wyn build --fast app.wynSkip optimizations (fastest compile)
wyn build --debug app.wynKeep 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:

bash
$ 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 window

Set an [app] identifier in wyn.toml before you ship: macOS treats two bundles sharing one identifier as the same application.

Cross-Compilation

bash
wyn cross <target> app.wyn

Targets: 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

CommandDescription
wyn cross ios app.wynCross-compile an arm64 iOS binary (needs Xcode's iOS SDK)
wyn cross android app.wynCross-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

CommandDescription
wyn new <name>Scaffold a project (--template cli|api|web|lib) with wyn.toml, src/, tests, CI
wyn testRun tests in tests/ directory (cross-platform, no shell)
wyn test tests/expectRun tests in a specific directory
wyn test <name>Run only tests whose name matches
wyn fmt app.wynFormat source code (4-space indent, no semicolons)
wyn fmt src/ --checkCheck formatting without modifying (for CI)
wyn doc app.wynGenerate documentation
wyn lspStart language server
wyn debug app.wynDebug with DWARF + lldb
wyn watch app.wynWatch and auto-rebuild on save
wyn design [form.json]New in v1.21 - visual form designer (needs the gui package)
wyn replInteractive REPL
wyn bench app.wynBenchmark with timing
wyn uiInteractive command browser
wyn doctorCheck your setup
wyn upgradeUpdate 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.

CommandDescription
wyn add <name|url>[@ref]Add a dependency (git repo); --as <name> overrides the import name
wyn remove <name>Remove a dependency
wyn listList declared dependencies
wyn restoreInstall all deps from wyn.lock / wyn.toml, pinned
wyn pkg auditVerify 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 just fn main() { ... }
  • String interpolation: "hello ${name}"
  • Method chaining: x.transform().format()

See Also

MIT License - v1.21.0