language · keyword ·
extern
Declare a native C boundary
Use C interop at a narrow adapter boundary after confirming the exact target ABI and admitted scalar types.
externStatus: experimental
Extern abi manifest
Use C interop at a narrow adapter boundary after confirming the exact target ABI and admitted scalar types.
cpu · complete-program · type checked
extern c NativeScore(int value) returns int
extern c stdcall NativeFlag(bool enabled) returns bool
Console.Log("extern-abi-manifest-ok")
project.mech
package = "tests.compiler.kyber.externAbiManifest"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false
capabilities = ["native"]
acknowledgedAdvisories = ["extern.c"]
Notes and source
The bootstrap compiler supports only extern c.
Interop beyond admitted scalars is experimental and must match the target ABI exactly.
yeho/parser_declarations.cpp parseExternFunction; conformance extern-c-beyond-admitted-scalars