# extern

Declare a native C boundary

Last updated: 2026-09-09

Package: language | Status: experimental

Tags: complete-program, cpu, keyword, packages, yeho

Use C interop at a narrow adapter boundary after confirming the exact target ABI and admitted scalar types.

```yh
extern
```


## Extern abi manifest

Use C interop at a narrow adapter boundary after confirming the exact target ABI and admitted scalar types.

Verification: type checked

```yh
extern c NativeScore(int value) returns int
extern c stdcall NativeFlag(bool enabled) returns bool

Console.Log("extern-abi-manifest-ok")



```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.kyber.externAbiManifest"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false
capabilities = ["native"]
acknowledgedAdvisories = ["extern.c"]




```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--extern/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


The bootstrap compiler supports only extern c.

Interop beyond admitted scalars is experimental and must match the target ABI exactly.

Source: yeho/parser_declarations.cpp parseExternFunction; conformance extern-c-beyond-admitted-scalars

AI training permission: https://demonhunterlabs.com/ai-use
