Name mangling specification
Decision summary
Section titled “Decision summary”- Mangling is always applied.
- Type parameters are included in the mangled signature.
- The prefix is
pn::.
Format
Section titled “Format”pn::<module_path>::<item_name>$<kind>(<param_types>,<return_type>)Examples
Section titled “Examples”- Function:
pn::net.http::connect$function(i64,str,Result[str]) - Method:
pn::net.http::Client::connect$method(self,Url,Result[str]) - Generic:
pn::collections::Map::insert$method(self,K,V,Option[V])
Module path rules
Section titled “Module path rules”src/net/http.bd->net.httpsrc/net/http/client.bd->net.http.client
Type encoding
Section titled “Type encoding”i64,f64,bool,str,ptr,unitare literal tokens.- Generic params use their identifier (
K,V,T). - Composite types:
Option[T]->Option[T]Result[T,E]->Result[T,E]Array[T]->Array[T]
Rationale
Section titled “Rationale”- Always-on mangling avoids symbol collisions across modules.
- Type parameters in signature allow monomorphized symbols to coexist.
pn::prefix ensures a unique namespace for linking.