From 68d493c5f261a99b40d90e2cc4f08b24d1975234 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 17 Jan 2026 21:22:52 +0000 Subject: chore(examples): New example for LUA bindings --- examples/scripting/lua/README.md | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/scripting/lua/README.md (limited to 'examples/scripting/lua/README.md') diff --git a/examples/scripting/lua/README.md b/examples/scripting/lua/README.md new file mode 100644 index 0000000..dea8fa2 --- /dev/null +++ b/examples/scripting/lua/README.md @@ -0,0 +1,46 @@ +# Lua Scripting with Zen-C + +This examples demonstrates how to build your Zen-C application with Lua C bindings,
+and how you can call Lua code from Zen-C (.zc) context, or exposed Zen-C functions from Lua (.lua) context. + +> Lua is a powerful, efficient, lightweight, embeddable scripting language, often used in games. + +--- + +Example output: + +![alt text](https://i.imgur.com/5vfGuVg.png) + +## Setup + +Get Lua 5.4 headers and lib: + +```sh +./deps.sh +``` + +This will leave the headers (.h) and lib (.a) inside a folder called ``lua``. + +## Build + +```sh +zc build lua.zc -o lua +``` + +## Run + +Either + +```sh +zc run lua.zc +``` + +or (after compilation) + +```sh +./lua +``` + +## Documentation + +- https://www.lua.org/manual/5.4/manual.html -- cgit v1.2.3