Fundamentals

Source files

Karkain source files use the .kark extension. Every top-level statement is evaluated in declaration order — there is no implicit main() entry point.

print("hello")

Comments

Line comments start with // and run to end-of-line:

// this is a line comment
let x = 1  // inline comment

Block comments use /* … */:

/* this is a
   block comment */

Nesting /* */ is supported in the Go front end only; the self-hosted kcc engine does not support nested block comments.

Keywords

The following are reserved keywords:

let, var, func, return, if, else, while, for, in, match, struct, enum, import, public, true, false, nil, spawn, send, receive, channel, actor, actorSend, actorState, setActorState, actorStop, wait_all, break, continue, assert, assert_eq, assert_ne, test

Statements

A program is a sequence of top-level statements:

let greeting = "hello"
print(greeting)