Rook
РусскийRU

Tools

The compiler is the npm package rooklang, and it runs on Node.js 24 or Bun. The compiled code imports the runtime, rooklang/runtime, so the package is a dependency of the project:

Terminal
npm install rooklang
npx rook build app.rk            # app.js next to the source
npx rook build src --out-dir dist   # every module of a folder
npx rook run app.rk              # compile and run
npx rook run --watch app.rk      # and again on every change
npx rook build app.rk --markup   # with markup and components

These are the commands used to build and run the board as its modules appear. With markup enabled it can be checked in the browser; the server version is run by Node or Bun.

Vite projects have a plugin, rooklang/vite: with it .rkmodules are imported like any others, and type errors show up over the page. This site is built that way; its package.json turns markup and components on.

In Bun, preload = ["rooklang/bun/register"] in bunfig.toml lets Bun load .rk modules itself: bun app.rk, imports from TypeScript and bun test, with goroutines.

For VS Code there is the extension Rook Language: highlighting, errors as you type and completion. VSCodium, Cursor and other editors take it from Open VSX.

The compiler is written in TypeScript; the source code is in the GitHub repository. The language specification with the reasons for its decisions is in docs/spec.md, the design of components in docs/components.md. This page is written in Rook too: its code is in site/src, and the server, written with components of the server, is site/server/main.rk. From the root of the repository:

Terminal
npm run site:dev         # this site on the Vite dev server
npm run vscode:install   # the VS Code extension from the source