You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the first official release of Ziglua supporting Lua 5.1, 5.2, 5.3, and 5.4 and targets Zig 0.10.0. Although incomplete, it is close enough to what I envision for the final library to share.
4
+
5
+
The API wrappers expose nearly every function and constant from the four Lua APIs, and each wrapper is well tested. I started development with Lua 5.4, and then worked my way backward for the other Lua versions, removing functions that are not supported by the older versions. This means that Lua 5.4 is the most complete of the four, though all should be ready to use.
6
+
7
+
There is still plenty of work for the future:
8
+
* Updating documentation comments. Because I copied the Lua 5.4 wrapper for the other three versions, the comments still point to Lua 5.4's reference manual.
9
+
* Updating function signatures. Most of the functions shouldn't change at this point, but there are a few that might as I use Ziglua more. For example, some functions return types that must be discarded with `_ = ` in Zig if the return value is not used. For some functions I have two versions, one that returns the value and another that doesn't. I still haven't decided if the two-function wrapper is the best way yet, but I want the API to be the best it can be.
10
+
* Updating the library as Zig inevitably introduces breaking changes going forward.
11
+
* Adding LuaJIT support.
12
+
* As Zig gains an official package manager, I want to delete the Lua source code from the repo and pull it at build time.
13
+
14
+
So feel free to use Ziglua at this point! It *will* change, but I will try to keep things documented here as best I can as the project moves forward.
Copy file name to clipboardexpand all lines: readme.md
+11-6
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,19 @@
2
2
3
3
[](https://github.com/natecraddock/ziglua/actions/workflows/tests.yml)
4
4
5
-
A Zig library that provides a complete and lightweight wrapper around the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, and 5.4.
5
+
A Zig library that provides a complete and lightweight wrapper around the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, and 5.4 and targets Zig 0.10.0.
6
6
7
-
The Ziglua library offers two use cases:
8
-
***embedded**: used to statically embed the Lua VM in a Zig program
9
-
***module**: used to create shared Lua modules that can be loaded at runtime in other Lua-based software
7
+
Ziglua can be used in two ways, either
8
+
***embedded**to statically embed the Lua VM in a Zig program,
9
+
*or as a shared **module**to create Lua libraries that can be loaded at runtime in other Lua-based software.
10
10
11
-
In both cases, Ziglua will compile Lua from source and link against your Zig code making it easy to create software that integrates with Lua without requiring Lua libraries installed on your system.
11
+
In both cases, Ziglua will compile Lua from source and link against your Zig code making it easy to create software that integrates with Lua without requiring any system Lua libraries.
12
12
13
13
Like the Lua C API, the Ziglua API "emphasizes flexibility and simplicity... common tasks may involve several API calls. This may be boring, but it gives us full control over all the details" (_Programming In Lua 4th Edition_). However, Ziglua takes advantage of Zig's features to make it easier and safer to interact with the Lua API.
@@ -72,6 +73,10 @@ Nearly all functions, types, and constants in the C API have been wrapped in Zig
72
73
73
74
Nearly all functions have associated Zig tests. Ziglua should be relatively stable and safe to use now, but I am still polishing things and function signatures may change from time to time.
74
75
76
+
## Contributing
77
+
78
+
Please make suggestions, report bugs, and create pull requests. Anyone is welcome to contribute!
79
+
75
80
## Acknowledgements
76
81
77
82
Thanks to the following sources:
@@ -80,4 +85,4 @@ Thanks to the following sources:
80
85
*[zig-autolua](https://github.com/daurnimator/zig-autolua) for help on writing an alloc function
81
86
*[mach-glfw](https://github.com/hexops/mach-glfw) for inspiration on a clean `build.zig`
82
87
83
-
And finally [Lua](https://lua.org). Thank you to the Lua team for providing a great language!
88
+
And finally [Lua](https://lua.org). Thank you to the Lua team for creating and sharing such a great language!
0 commit comments