Introducing Hike: An alternative Go compiler implemented 100% in Go, for zero-runtime, tiny Wasm, and Cgo-free native libraries

Hi everyone,

Hike is an alternative Go compiler implemented 100% in Go.

In fact, a significant amount of standard Go source code already compiles directly with Hike today.

Why build another Go compiler? Go is exceptional for backends and network services, but standard Go’s runtime assumptions (GC, M:N scheduler, and Cgo mechanics) make certain low-level, performance-critical domains structurally difficult. Hike was built not to replace Go or fork the community, but to solve specific architectural bottlenecks that the official toolchain cannot easily address.

The Real-World Friction Hike Solves

  1. Instant, Zero-Overhead C-ABI Calls: Calling C via Cgo incurs substantial overhead (goroutine stack switching, signal handling, scheduler interaction) and severely impairs seamless cross-compilation.

  2. Tiny Wasm Payloads with Zero Heap Drift: Standard Go Wasm binaries bundle the runtime and GC, easily ballooning to multiple megabytes and generating steady heap allocation.

  3. Packaging Complex Native Desktop/Graphics Libraries: Dynamic extraction tricks (like dropping embedded .dll/.so files to /tmp at runtime) are increasingly blocked by modern enterprise AV/EDR software or hardened noexec mounts.

Core Capabilities

1. Direct C-ABI Calling & Native Shared Library Generation

In Hike, calling native C functions requires zero glue code, wrapper layers, or Cgo. You simply write standard Go-style function declarations:

Go

// Direct C-ABI call lowered to a native machine instruction
func abs(n int32) int32

Hike also compiles directly into native shared libraries (.so / .dll), automatically generating complete, fully-typed C++ header files ready for external toolchains.

2. Ultra-Lightweight WebAssembly (From 1.4KB, Zero Heap Overhead)

When targeting WebAssembly, Hike emits clean, compact binaries:

  • Base binary sizes start at ~1.4KB.

  • Executes 10,000+ continuous function calls with zero heap memory growth, ensuring rock-solid predictability.

  • Features a built-in DWARF emitter, providing step-through line debugging directly inside Chrome DevTools without relying on heavy external toolchains.

3. Cgo-Free Static Linking via .sxso

Hike leverages Go’s native static object specification (.sxso). By automating the bridge between prebuilt C++/Rust static archives and .sxso objects, Hike enables seamless, Cgo-free static compilation within standard Go projects.

We have already used this technique to deliver fully working, Cgo-free Go bindings for major modern GUI and system libraries:

  • Slint (Declarative UI framework)

  • wgpu (WebGPU native implementation)

  • winit (Cross-platform window creation)

  • SDL3

A Complementary Tool for Gophers

Hike is not an adversarial project. It is a complementary tool designed to expand what Go developers can build, allowing them to bring Go’s clean syntax and engineering efficiency into domains where heavy runtimes cannot survive: microcontrollers, edge nodes, real-time GUI applications, and bandwidth-constrained Wasm sandboxes.

The project is completely open source:
:backhand_index_pointing_right: GitHub: GitHub - kanryu/hike-lang: A zero-overhead systems language uniting Go ergonomics with bare-metal performance: zero-GC, direct C-ABI, and ultra-lightweight, WASI-free WebAssembly (normal & concurrent). · GitHub

I welcome all feedback, critique, and technical discussions from the community!