Principles
Rook — 1.0 specification
- JS semantics. The same values, objects, classes, closures, modules and standard library
(
console, Math, JSON, methods of arrays and strings).
- 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.
- 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.
- 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.
- Compatibility with JS. Rook can import any JS module, and a compiled module can be
used from JS.
Markdown source on GitHub