Kinmokusei Language Manual
This manual builds one coherent model of the language, from accepted source text through values, control flow, modules, failures, and concurrency.
Use the Manual to understand how concepts fit together, the Guide to complete a task, and the Reference to look up an exact contract. Those layers link to one another without trying to repeat the same page three ways.
Core language path
- Source text and lexical structure: files, comments, identifiers, keywords, literals, punctuation, and semicolons.
- Bindings and scope:
const,let, inference, mutation, shadowing, multiple results, and visibility. - Expressions and evaluation: values, composite literals, calls, conversions, assertions, propagation, and evaluation order.
- Control flow: conditions, loops, switches, select, labels, defer, and exception boundaries.
- Modules and imports: per-file scope, explicit relative imports, Go packages, standard modules, and project dependencies.
Program design path
- Types and values: scalar and composite shapes, copy versus alias, nominal identity, pointers, interfaces, and nullability.
- Functions and generics: signatures, arrows, callbacks, variadics, type parameters, constraints, methods, and result effects.
- Structs, classes, and interfaces: value/reference design, constructors, visibility, properties, shared static state, inheritance, and typed decorators.
- Failures, results, and exceptions: raw Go errors,
Result, propagation, typed exceptions, panic, cleanup, and absence. - Concurrency and tasks: raw goroutines, structured tasks, channels, select, cancellation, and shared state.
Ecosystem paths
How examples are presented
Every syntax chapter separates four questions:
- What tokens and form do I write?
- What type and scope rules apply?
- What evaluates, in what order, and how often?
- What does the compiler reject before Go generation?
Runnable recipes are compiled by the documentation check. Intentionally invalid examples are checked against narrow diagnostic fragments. The implementation and its automated tests remain the behavioral source of truth.
The following compact program is the executable contract shared by these chapters:
import go fmt from "fmt";
type UserID = distinct string;
enum Mode { Ready, Complete }
struct Pair<T> {
public left: T;
public right: T;
}
interface Named { function name(): string; }
class User implements Named {
constructor(public id: UserID, private display: string) {}
public function name(): string { return this.display; }
}
function identity<T>(value: T): T { return value; }
function render(user: User | null, mode: Mode): bstring {
if (user === null) { return "guest"; }
const decorate = (value: string): string => "[" + value + "]";
const pair = Pair<int> { left: 1, right: 2 };
let total = pair.left + pair.right;
for (const value of [3]) { total += value; }
switch (mode) {
case Mode.Ready { return decorate(identity(user.name())) + ":" + fmt.Sprint(total); }
default { return "complete"; }
}
}
function main(): void {
const user = new User(UserID("42"), "Aki");
fmt.Println(render(user, Mode.Ready));
fmt.Println(render(null, Mode.Complete));
}It combines a defined domain type, enum, generic value struct, interface/class implementation, nullable narrowing, typed arrow, range loop, and value switch. The documentation check expects:
[Aki]:6
guestIf you want to write a program immediately, use the five-minute quick start. If you already know the language, jump to the Reference. The Glossary resolves terms such as addressable, nominal, storage aliasing, flow fact, and Go boundary without interrupting the chapter sequence.