Wave

wave is the cargo of Marina — one CLI for the compiler, the runtime, and the package manager. Build it from the repo root:

Install

The installer clones the repo, builds wave and marina-lsp, and links them into ~/.local/bin. The checkout stays at ~/.marina/src because wave links its runtime from there.

Requirements: git, CMake ≥ 3.20, a C++20 compiler, clang, and libsqlite3.

From a checkout, the same binaries are:

$ cmake -S . -B build && cmake --build build -j
# binaries: build/wave, build/marina-lsp

Commands

CommandWhat it does
wave initcreate package.json + src/main.tsm in the current directory
wave add <path|git-url>install a package into the global registry + record it in package.json
wave remove <pkg>remove a dependency from package.json
wave check [file]validate package.json + type-check the entry point (no codegen)
wave build [file]compile to a native binary in ./.marina/
wave run [file]compile + execute (binary and IR go to a temp dir)

Without [file], wave uses the project entry point: the "main" field of package.json, defaulting to src/main.tsm. With a [file] argument, wave works anywhere — even outside a project (wave run examples/objects.tsm).

Projects

Projects are described by a package.json in the project root:

{
    "name": "<project-name>",
    "version": "0.0.1",
    "dependencies": {
        "my-pkg": "0.3.0"
    }
}

One-off files

wave run and wave build work on any .tsm file, even outside a project:

# compile + run in one step
$ wave run examples/hello-world.tsm

# compile to a native binary in ./.marina/
$ wave build examples/hello-world.tsm
$ ./.marina/hello-world

build also writes the textual LLVM IR next to the binary (./.marina/<name>.ll) so you can inspect what your program compiles to.

The compiler pipeline

Wave drives a four-stage pipeline: lex & parse → AST, type check (strict, with inference — a type error aborts compilation), codegen to textual LLVM IR including ARC retain/release insertion and async state machines, then link with clang against libmarina_runtime.a — ARC, promises, the poll(2) event loop, and the net/http/fs/crypto/sql std modules.

Editor support

Marina ships its own language server (marina-lsp) — a dependency-free JSON-RPC implementation over stdio that reuses the compiler's lexer/parser/checker. Install it on your PATH, then load the editors/marina-lsp/marina-lsp-0.2.2.vsix extension in Cursor/VS Code for:

  • Live strict diagnostics on open, keystroke and save
  • Syntax highlighting via a TextMate grammar, and 🌊 wave file icons
  • Hover on declared class names → field shapes (including ghost classes)