Overhauled FFI to be way better
- Cleaner support in modu
- Supports strings, integers, floats, ints and null arguments (only strings before)
- Supports string, integers, floats, ints and null returns (only strings before)
Old:
import "ffi" as ffi;
ffi.call(path, "hello_world");
print(ffi.call(path, "one"));
print(ffi.call(path, "add", 5, 2));
print(ffi.call(path, "string"));
ffi.call(path, "print", "test");
New:
import "ffi" as ffi;
let lib = ffi.load(path);
lib.hello_world();
print(lib.one());
print(lib.add(2, 5));
print(lib.string());
lib.print("test");