Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/guide/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```