Generic lua for zig
Find a file
2026-07-28 11:17:37 +01:00
src Allow for use of custom allocators for lua 2026-07-28 11:17:37 +01:00
.gitignore first commit 2026-07-27 10:07:04 +02:00
build.zig Changed from root.zig to zla.zig 2026-07-27 09:36:03 +01:00
build.zig.zon first commit 2026-07-27 10:07:04 +02:00
README.md Allow for use of custom allocators for lua 2026-07-28 11:17:37 +01:00

Simple

// --- ZLA ---
var zla: Zla = try .init(allocator);
defer zla.deinit();

// --- EXEC FILE ---
try zla.execFromFile(
    void,
    "src/scripts/basic.lua",
);

// --- CALL ---
try zla.call(void, "hello", .{"World"});
try zla.call(void, "hello", .{"..."});

Call lua directly

const val = try zla.exec(i64, "return 6 * 9");

Call function from lua

try zla.call(void, "hello", .{"World"});

Call function from lua with return type

const coords = try zla.call(
    struct { f64, f64 },
    "getCoords",
    .{},
);

Dependancies

sudo pacman -Sy lua --needed