Skip to content

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.

Install the repository’s declared Node and pnpm versions, clone the repository, and run:

pnpm check:deps
pnpm install
pnpm check:deps
pnpm --filter @nlk/cli build

The 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.nlk

If 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.

Create hello.nlk:

print("hello, Nilakan")

Run it:

nilakan hello.nlk

The CLI requires file input to use the .nlk extension.

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 -
def add(left: num, right: num) -> num:
return left + right
print(add(2, 3))

Parameter and return annotations are runtime type contracts.

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.

The browser editor lives at /editor/. The documentation lives at /docs/, and both can be served together with the repository dev:web script.

See the CLI reference for all supported options and exit codes.