Tuck In

Getting Started

From zero to a running lykn project in five minutes. Prerequisites, installation, your first program, and the tools that keep your code clean.

Prerequisites

Rust & Cargo

The lykn compiler is a Rust binary

# Install Rust via rustup (if you don't have it)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Verify
cargo --version

Deno

Runtime for compiled JavaScript — not Node.js

# macOS / Linux
curl -fsSL https://deno.land/install.sh | sh

# or via Homebrew
brew install deno

# Verify
deno --version

Git

lykn new initializes a git repo

git --version

Make

Optional — for the lykn project's own build system

# macOS: included with Xcode Command Line Tools
xcode-select --install

# Linux: usually pre-installed, or
sudo apt install build-essential

Install lykn

From crates.io

The standard install path

cargo install lykn-cli

This installs the lykn binary. Verify it works:

lykn --version
lykn --help

From source

For contributors or bleeding-edge

git clone https://github.com/lykn-lang/lykn.git
cd lykn
make build
# Binary lands in ./bin/lykn

Create a Project

lykn new

Scaffolds a workspace with one package

lykn new my-app
cd my-app

This creates:

my-app/
├── project.json              # workspace root
├── packages/my-app/
│   ├── deno.json             # package config
│   └── mod.lykn              # entry point
└── test/
    └── mod.test.js           # test stub

The starter program

packages/my-app/mod.lykn

lykn

;; my-app — created with lykn new

(bind greeting "Hello from my-app!")
(console:log greeting)

compiled javascript

const greeting = "Hello from my-app!";
console.log(greeting);

Format, Lint, Check

lykn fmt

Format lykn source files

# Check formatting (dry run)
lykn fmt packages/my-app/mod.lykn

# Format in place
lykn fmt -w packages/my-app/mod.lykn

lykn check

Validate syntax without compiling

lykn check packages/my-app/mod.lykn

lykn lint

Lint compiled JavaScript via Deno

lykn lint packages/

Testing

lykn test

Runs tests via Deno's built-in test runner

# Run all tests
lykn test

# Run specific test files
lykn test test/mod.test.js

Tests are written in JavaScript and import the compiled output. The scaffold includes test/mod.test.js to get you started.

The full check

Everything at once

# Format → check → compile → test
lykn fmt -w packages/**/*.lykn
lykn check packages/my-app/mod.lykn
lykn compile packages/my-app/mod.lykn -o dist/mod.js
lykn test

Run It

lykn run

Compile and execute in one step

lykn run packages/my-app/mod.lykn
# → Hello from my-app!

lykn compile

Compile to a .js file you can inspect

# Compile to stdout
lykn compile packages/my-app/mod.lykn

# Compile to a file
lykn compile packages/my-app/mod.lykn -o dist/mod.js

# Production build (strip runtime type checks)
lykn compile packages/my-app/mod.lykn --strip-assertions -o dist/mod.js

Next Steps

You've got a running project. Here's where to go from here.

The Tour — walk through the language in 10 interactive examples

Reference — every form, every syntax, every compilation rule

Playground — write lykn in your browser, see the compiled JS, run it

The Book — the full story, from bindings through macros and compiler internals

Discord — come say hello