# Rook — 1.0 specification

**English** · [Русский](../../ru/reference/language/index.md)

Rook is a language with the semantics of JavaScript, Go-style syntax and static types. Its
main feature is goroutines: `go f(x)` runs a function as a goroutine, on another processor, and
channels and `select` connect goroutines, as in Go (section 5). It compiles to readable JavaScript
(ES modules), and the types are erased at compile time.

## Chapters

- [Compatibility in 1.x](../../reference/language/compatibility/index.md): Rook follows Semantic Versioning. A 1.x minor release can add backward-compatible features. A patch release can fix bugs. Changes that break the public…
- [Principles](../../reference/language/principles/index.md): Principles. Syntax, runtime behavior and examples in the Rook technical reference.
- [Lexical structure](../../reference/language/lexical-structure/index.md): // to the end of the line and / block /.
- [Variables](../../reference/language/variables/index.md): A const cannot be reassigned; the compiler checks that.
- [Types](../../reference/language/types/index.md): The type goes after the name, without a colon: x number, xs string[], cb func(number) bool, user ?User.
- [Functions](../../reference/language/functions/index.md): Adjacent parameters of the same type can be grouped: a, b number is the same as a number, b number.
- [Concurrency](../../reference/language/concurrency/index.md): JavaScript runs a program in one thread. Rook keeps that thread for waiting and gives the work that keeps a processor busy to other threads, with the means…
- [Conditions and loops](../../reference/language/control-flow/index.md): No parentheses around the condition, braces are required. The condition must be a bool: unlike JS, there is no truthy/falsy. if count { is an error, write if…
- [Errors](../../reference/language/errors/index.md): Expected errors (wrong input, a file not found) are returned as the last value, of type error:
- [Classes](../../reference/language/classes/index.md): Classes as in JS and TypeScript, with Go-style types. Methods are declared without func, like methods of JS classes.
- [Interfaces](../../reference/language/interfaces/index.md): An interface describes the shape of a value: its fields and methods. As in TS, it exists only at compile time.
- [Modules](../../reference/language/modules/index.md): Imports and exports become ES modules one to one; export interface and export type disappear at compile time.
- [Operators: differences from JS](../../reference/language/operators/index.md): The rest is as in JS: arithmetic, comparisons, bitwise operations, , ??, ?., ? :, typeof, instanceof, new, spread ..., indexing xs[i].
- [Type checking](../../reference/language/type-checking/index.md): The compiler checks types before generating JS; a program with type errors does not compile (rook build --no-check skips the check).
- [Example](../../reference/language/hello-world/index.md): examples/hello.rk
- [After 1.0](../../reference/language/future/index.md): Planned next, around goroutines and what the browser has:

