Getting Started
Nilakan programs are stored in .nlk files and run with the repository CLI. There is not currently
a published package installer or standalone binary, so the commands below start from a repository
checkout.
Build The CLI
Section titled “Build The CLI”Install the repository’s declared Node and pnpm versions, clone the repository, and run:
pnpm check:depspnpm installpnpm check:depspnpm --filter @nlk/cli buildThe first check:deps verifies the required Node and pnpm versions and reports whether the checkout
needs installation. After pnpm install, run it again to verify the workspace, lockfile, installed
dependencies, and required tools. The filtered build produces packages/cli/dist/index.js. After
that, replace nilakan in the examples below with pnpm --silent nilakan:
pnpm --silent nilakan hello.nlkIf you deliberately expose the compiled CLI as a nilakan executable in your own environment, the
shorter commands below are equivalent. The installed CLI also provides nlk as an alias.
Run A File
Section titled “Run A File”Create hello.nlk:
print("hello, Nilakan")Run it:
nilakan hello.nlkThe CLI requires file input to use the .nlk extension.
Run From Stdin
Section titled “Run From Stdin”Use - to read source from stdin:
cat hello.nlk | nilakan -From the repository without a separately exposed binary:
cat hello.nlk | pnpm --silent nilakan -On Windows PowerShell:
Get-Content hello.nlk | nilakan -On Windows cmd.exe:
type hello.nlk | nilakan -First Function
Section titled “First Function”def add(left: num, right: num) -> num: return left + right
print(add(2, 3))Parameter and return annotations are runtime type contracts.
First Commit Loop
Section titled “First Commit Loop”Use init to create loop state and primed assignment to stage the next state.
def exchange() -> tuple[num, num]: init: left = 1 right = 2 done = False while not done: left' = right right' = left done' = True return left, right
print(exchange())Both primed assignments read the same current state. The loop then commits both next-state values together.
Editor
Section titled “Editor”The browser editor lives at /editor/. The documentation lives at /docs/, and
both can be served together with the repository dev:web script.
CLI Reference
Section titled “CLI Reference”See the CLI reference for all supported options and exit codes.