Principles

Rook — 1.0 specification

  1. JS semantics. The same values, objects, classes, closures, modules and standard library (console, Math, JSON, methods of arrays and strings).
  2. Go syntax where it is more convenient: func, the type after the name, multiple results, defer, zero values, conditions without parentheses, a single for loop, switch without break, no semicolons.
  3. Concurrency as in Go. go f(x) runs a function as a goroutine, on another processor, and channels and select pass values between goroutines. The compiler checks that what goes between threads can be copied.
  4. Static types with null safety. The compiler finds type errors; null can only be assigned to a type that explicitly allows it. JS code has no types.
  5. Compatibility with JS. Rook can import any JS module, and a compiled module can be used from JS.

Markdown source on GitHub