Skip to content

Commit f3c969a

Browse files
authored
Merge pull request #1 from furesoft/furesoft-foreign-functions
Add Foreign Functions
2 parents aa2a2db + d277f5e commit f3c969a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/guide/functions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,13 @@ counter() // 3
230230
```
231231

232232
The `makeCounter` function returns a counter function which will print sequential numbers when called.
233+
234+
## Foreign Functions
235+
236+
A foreign function declaration can be used to import functions from the webassembly host.
237+
238+
```grain
239+
foreign wasm alert: WasmI32 => Void from "host"
240+
241+
alert(42)
242+
```

0 commit comments

Comments
 (0)