Hi Jason,
Thanks for the questions! First, here is the project repository: https://github.com/kanryu/hike-lang
Here is how Hike handles these low-level aspects:
How "PC is not in moduledata" is avoided: Hike emits a pair of files for Go: the native .syso object file and the accompanying Plan 9 assembly file (stub.s). When you run go build, the Go toolchain automatically discovers both .syso and stub.s in the package directory and statically links them using Go's official, standard linking procedure. Because they are integrated through Go's own supported static linking mechanism, the symbols and code addresses are registered properly by the linker, so the "PC is not in moduledata" error simply does not occur.
Work viable on a NOSPLIT stack: By default, the assembly layer in stub.s generated by Hike automatically inserts a bidirectional trampoline. It switches the execution context from Go's goroutine stack to the OS/system stack before calling the foreign function, and switches back upon return. This allows C/native libraries to run with a standard, full OS stack without overflowing Go's small stack.
Only when the programmer explicitly declares a function as passthrough cfunc, Hike skips this stack-switching trampoline. In this case, the call executes directly on the NOSPLIT stack with zero transition overhead, but the programmer takes full responsibility for ensuring the library logic safely fits within Go's ~2KB headroom.
Best regards, KATO
Hi Sébastien,
Thanks for sharing the repository link and joining the thread!
To answer directly: at present, Hike implements no memory management runtime at all.
However, in the context of our primary use case—bridging existing C libraries into Go without Cgo—we believe this completely hands-off stance is actually the most sensible design. If Hike were to introduce its own memory management layer between Go's GC and C's native allocations, it would create conflicting lifecycles and pointer-tracking frictions, essentially reinventing the complexities that make Cgo difficult to work with. Acting as a strictly transparent, zero-runtime C-ABI pipeline allows Go and C to negotiate buffers and ownership directly without interference.
Looking ahead, as Hike evolves into an independent systems language, our plan is to provide three distinct, pluggable memory management models that developers can choose from on a per-project basis:
Arena (Bump) Allocation: Region-based allocation ideal for thread-pool tasks and request pipelines, enabling rapid allocations and bulk reclamation upon completion.
Reference Counting (ARC): Deterministic reclamation for resource-heavy system components without global stop-the-world pauses.
Garbage Collection: Automatic collection for general-purpose programming where convenience is prioritized over manual lifetime tuning.
Salt's approach using Z3 for static verification is indeed fascinating. For now, keeping the compiler pipeline modular allows us to explore these strategies without sacrificing the lightweight nature of the Go-C interop boundary.
Best regards, KATO