Symbol Mangling

Current symbol naming behavior and interop escape hatches.

Zynx mangles symbols to encode module names, functions, methods, and generic specializations. Mangling keeps generated native symbols distinct after LLVM lowering and linking.

Unmangled Symbols

Interop modules can request stable external names with @unmangled.

@unmangled
export fn add(a: i32, b: i32) -> i32 {
    return a + b;
}

@c_name is available for C-facing names in supported positions.

Snapshots

The compiler test suite includes mangling snapshots for ordinary and generic symbols. These are regression tests, not a public ABI promise.

Warning

Mangled names may change while Zynx is unstable. Use explicit interop attributes for externally consumed symbols.