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

Introduction

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

This page is divided into 2 parts: loading a library and how to use Wi API to create your own library.

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

Work in progress.

Clone this wiki locally