Skip to content

Go interoperability matrix ​

The compiler loads real export/type information for the selected Go version, module graph, target, tags, and CGO state. Support is determined lazily for referenced declarations and reachable shapes.

Namespace and named import go forms select the same original exports. Named imports can supply local aliases without changing Go type identity; manifest source import aliases never rewrite Go package paths.

Declarations and values ​

Go surfaceStatusKinmokusei boundary
Package constantsImplementedQualified namespace member; untyped constant rules preserved
Package variablesImplementedQualified value with Go mutability/addressability
FunctionsImplementedOrdinary call; multiple results remain multiple
Named and alias typesImplementedPackage identity and alias transparency preserved
Structs, fields, tagsImplementedGo literal/field selector rules for exported fields
Pointers and nilImplementedRaw low-level Go pointer/nil semantics
Methods and method valuesImplementedValue/pointer method sets and addressability preserved
Function values/callbacksImplementedChecked against the original Go signature

Type shapes ​

ShapeStatusNotes
All Go basic typesImplementedIdentity/width preserved; explicit conversions
Go runtime stringImplemented as bstringArbitrary bytes; checked string(raw) returns Result<string>
Arrays, slices, mapsImplementedNamed collections and copy/alias behavior preserved
Anonymous structsImplementedExported reachable fields/tags preserved
InterfacesImplementedMethod sets, assignment, assertions, and type switches
Channels and directionsImplementedSend/receive/close/range/select behavior preserved
Multiple resultsImplementedDestructuring/reassignment, matching return forwarding and sole-call argument expansion; never tuple values
Raw errorImplementedExplicit split or postfix ? bridge
Generic named typesImplementedExplicit instantiation and identity
Generic functions/methodsImplementedInferred, partial, or full explicit arguments
ConstraintsImplemented when reachable/representableChecked using Go type information
unsafe.Pointer in public shapeRequires policy[go.interop].unsafe = "allow"

Calls and operations ​

OperationStatus
Variadic calls and final slice... expansionImplemented
Explicit Go-compatible conversionsImplemented
Interface assignment and explicit class conformanceImplemented
Checked as? and forced as! assertionImplemented
Explicit type-binding switchImplemented
Channel send/receive/checked receive/close/range/selectImplemented
Raw goroutine and defer callsImplemented
Supported unsafe compiler built-insImplemented behind allow policy

With explicit unsafe permission, unsafe.Slice and unsafe.SliceData accept constrained pointer/slice types with a common element contract, including native class elements. Source nullability is preserved. Lengths and offsets support integer-valued untyped constants and contextual shifts; negative constant lengths and overflowing constants are rejected. These checks do not make pointer arithmetic, lifetimes, aliasing, or unsafe.String backing storage safe automatically.

No implicit bridge turns (T, error) into a hidden wrapper, erases pointer identity for nullability, or converts a Go interface into a Kinmokusei class hierarchy.

Pointers to nominal native structs keep their source identity in matching source signatures and pointer receiver methods. Passing shared verified-text storage through Go any/interfaces is rejected: reflection could write unchecked bytes or invoke a callback with raw input. This includes string[], pointers to text-bearing records, classes and hidden implementation fields; generic storage must prove the same property for its complete bound. Go containers/callbacks use bstring, not a no-copy view of verified text. Scalar text and scalar-only by-value DTOs can be copied safely. Named generic interfaces are checked with their instantiated owner arguments, including inherited interface contracts. Source structural interfaces also inspect compatible class implementations; method signatures alone do not prove the absence of hidden verified-text fields.

For encoding/json decoder targets, use a raw DTO with bstring fields, then validate text before constructing the domain model. Native struct pointers with raw fields are supported too; see the checked class-input example.

Go assertions/type switches cannot establish UTF-8 validity. Use raw bstring at that boundary, then a checked conversion. Valid Go string constants may be verified at compile time. External Go code calling or mutating generated APIs must respect their source contracts: Go string itself carries no UTF-8 proof. See text at the Go boundary.

Package and target behavior ​

BoundaryContract
Standard/external packageSame importer and type model
Existing module graphRead-only during normal compilation
Locked project graphCanonical, offline, target-aware validation
OS/architecture filesSelected by locked GOOS/GOARCH/tags
Package-internal reflection/unsafe/assemblyAllowed when the selected Go toolchain builds it
CGO packageAvailable only with selected target/toolchain/libraries
Go internal and semantic versionsOriginal Go rules apply

Classification ​

keika interop audit reports:

  • supported: lossless under the default safe policy;
  • requires_unsafe: representable only with explicit unsafe permission;
  • unsupported: a reachable public shape cannot be represented;
  • package-load failure: the selected environment could not load the package.

Package load success does not guarantee that every export is supported. Conversely, an unused unsupported export does not prevent using the rest of the package.

Current explicit non-goals ​

  • Parsing or translating arbitrary Go source syntax into .km.
  • Reflection proxies that hide original package identity.
  • Automatic approximation of unsupported reachable shapes.
  • Treating public API connectivity as proof that every Go language feature has a Kinmokusei spelling.
  • Silently making unsafe or CGO boundaries portable across targets.

Kinmokusei is a pre-1.0 project. Documentation describes implemented behavior.