diff --git a/src/guide/functions.md b/src/guide/functions.md index a83a5092..4f6b58db 100644 --- a/src/guide/functions.md +++ b/src/guide/functions.md @@ -230,3 +230,13 @@ counter() // 3 ``` The `makeCounter` function returns a counter function which will print sequential numbers when called. + +## Foreign Functions + +A foreign function declaration can be used to import functions from the webassembly host. + +```grain +foreign wasm alert: WasmI32 => Void from "host" + +alert(42) +```