Skip to content
cyxigo edited this page Jul 17, 2026 · 5 revisions

Introduction

FFI (Foreign Function Interface) lets you call C functions from Wi.

Loading a library

To load a library you use a built-in function called load_foreign, which accepts library path as its only argument:

load_foreign("mylib");

You don't need to write an extension, .dll or .so - Wi handles these extensions internally depending on the platform you're running it on.

You can use load_foreign only in the main script. Main script is the script which you used to launch your program.

It will search in the foreign folder right next to the Wi executable.

Using Wi API

For that, check out Wi API Reference

Clone this wiki locally