Five-minute quick start
By the end of this page you will have checked one source file, run it, built an executable, and inspected its generated Go.
1. Create a source file
Save this program as hello.km:
import go fmt from "fmt";
function main(): void {
fmt.Println("Hello from Kinmokusei");
}import go gives the file an explicit namespace for an ordinary Go package. Nothing from fmt is placed into the file scope implicitly.
2. Check before running
keika check hello.kmA valid file produces no output and exits with status 0. check lexes, parses, resolves imports, and performs semantic checking; it does not generate or execute a program.
3. Run the program
keika run hello.kmExpected output:
Hello from Kinmokuseirun generates a project-local Go module, invokes the selected Go toolchain, and executes the program. A locked cross-target project is rejected before execution; use build for cross-compilation.
4. Build an executable
keika build -o hello hello.kmThe output is a native executable for the active or project-locked target.
5. Inspect generated Go
keika emit-go -o generated.go hello.kmThe generated file is formatted and intentionally readable:
// Code generated by Kinmokusei. DO NOT EDIT.
package main
import fmt "fmt"
func main() {
fmt.Println("Hello from Kinmokusei")
}emit-go is a publication boundary, not only a debugging aid. Generated output is standalone Go and does not require the compiler at consumer build time.
Read a diagnostic
If fmt.Println receives a value that cannot connect to the Go API, or a local is used with the wrong Kinmokusei type, check reports the original .km path and source span. Machine consumers can request the stable JSON envelope:
keika check --json hello.kmThe exit status is 0 for valid source, 1 for invalid source or project input, and 2 for command misuse. See Diagnostics for the schema.
Where next?
- Follow one program through the language tour.
- Learn exact value and reference behavior in Types and data.
- Add real packages with Go interoperability.