Skip to main content

Module go

Module go 

Source
Expand description

Go code generator — rule-based (Tier 2) transpilation from AIR to Go.

Handles all capability gaps:

  • Records → structs
  • Traits → interfaces
  • Algebraic types → structs with tag field + type switch
  • Pattern matching → switch/type-switch/if-else chains
  • Effects → interface parameters
  • Ownership → erased (Go is GC)
  • Generics → Go type parameters (Go 1.18+)
  • Concurrency → goroutines/channels
  • Error handling → (value, error) return tuples
  • String interpolation → fmt.Sprintf

Structs§

GoGenerator
Go code generator implementing the CodeGenerator trait.