ziglua
                                
                                 ziglua copied to clipboard
                                
                                    ziglua copied to clipboard
                            
                            
                            
                        new to zig and don't know how to use.
Hi, I'm new to zig and want to find a way to make Lua C module in zig, I found this great repo but I don't know how to use it.
I'm using zig 0.11 because it's the latest release on its GitHub page and Homebrew package manager. But it seems do not support zig fetch.
After some dig I realize I should write up the build.zig.zon and calculate the hash myself, is that right? but I cannot find any easy way to make up them.
So is it the right time to use zig? or I just wait 0.12 to release? or maybe I should build zig 0.12 myself instead of using official release?
zig is looking like a great language, but it's too hard to use :-(
update: after using 0.12 nightly, ziglua still do not work:
zig\p\12208603e0f51fa6ce7201d8e851c5979b6b78887434623ac87a0f2a5a3dd3e75130\build.zig:39:11: error: no field or member function named 'addOptions' in 'Build.Module'
    ziglua.addOptions("config", config);
    ~~~~~~^~~~~~~~~~~
zig-windows-x86_64-0.12.0-dev.1800+559e216f3\lib\std\Build.zig:1888:20: note: struct declared here
pub const Module = struct {
Hey @starwing sorry for the delay!
So is it the right time to use zig? or I just wait 0.12 to release? or maybe I should build zig 0.12 myself instead of using official release?
That is really up to you. It is a bit more difficult to follow along with Zig because it is unstable and constantly changing. But I found the longer I use Zig the easier it is for me to keep up with changes.
If you want to stick to Zig 0.11.0, use the 0.2.0 release of Ziglua: https://github.com/natecraddock/ziglua/releases/tag/0.2.0.
What you will do is add the package url to the build.zig.zon, and then run zig build. Then Zig will print out the hash for you to add it to the file.
The old readme has an example for Zig 0.11.0 https://github.com/natecraddock/ziglua/tree/b3f0d75b1815789be542001d8f12a2017b859538
Closing since it seems you figured things out. Let me know if you need anything else resolved!