Engine Compatibility
Karkain programs run on two engines. The Go front end is the reference
compiler; the self-hosted kcc engine is the primary engine for
check / build / run / test.
Feature parity matrix
Feature |
Go |
kcc |
|---|---|---|
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
Runtime error diagnostics (div-by-zero, OOB) |
Yes |
Yes |
Stack traces |
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Yes |
|
Yes |
Partial (surface syntax lexes and parses; the C helper emission is Go-engine only — tracked as kcc parity work) |
Cross-compilation ( |
Yes |
No (kcc does not implement target switching; use |
Nested block comments ( |
Yes |
No |
|
Yes |
No |
|
Yes |
No |
WASM target ( |
Yes |
No |
Closures / |
Partial ( |
Partial (same — byte-identical goldens on both engines) |
|
No |
No |
Note
Let-bound closures work on both engines. Only first-class
function values (ops[0](5), func(T) R types) and
closure-variable capture are open boundaries — identical on both
engines, tracked as future work.
Known divergences
constlocation reportingThe
kccengine reports the diagnostic at the declaration line of theconst. The Go engine reports it at the reassignment assignment.- Multi-argument
println Both engines print only the first argument. Multiple arguments are not concatenated or space-separated.
str()on arraysThe Go engine prints
["x"]whilekccprints[x](without quotes around string elements).- WASM target
WASM compilation (
--target wasm32-wasi) is only available on the Go engine and requireswasmtimeon the host. Thekccengine does not support WASM. Since Phase 123 the Go-engine WASM backend is a Production Candidate — WASI exit codes, stderr diagnostics andgetArgs()are implemented and gated.- Runtime errors and stack traces
Both engines produce identical
runtime error: <kind> at <file>:<line>diagnostics andstack:traces. The stack-trace format is tested across both engines with the same expected frames.