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
Currently each version of Lua/Luau that Ziglua supports has tests and bindings for that version. This results in a lot of duplicated code (which isn't too bad because Lua is a stable target). But as time has gone on, this leads to a lot of duplicated effort in the following cases
making large updates to Ziglua, like documentation format
breaking changes in Zig versions
This is annoying enough that I think it is worth it to find a way to simplify things down to just one of each ziglua.zig and tests.zig files.
I attempted this in the past with usingnamespace "mixins", but it was really messy. I want to attempt this again, but this time using conditional compilation based on the target version of Lua.
The text was updated successfully, but these errors were encountered:
I actually kind of liked how the different backends were duplicated. 🙂 It's very concrete that way. But I agree that it can be painful to keep all of these in sync. I think a very good first step would be to do this first for tests.zig. This will also nicely inform what might be missing from any of the different lib.zig versions.
I actually kind of liked how the different backends were duplicated. 🙂 It's very concrete that way
I agree, and that is why I originally wrote the code this way. But as you said, keeping things in sync has become painful. So I'm experimenting with this idea. If it turns out to be more of a mess/hassle, then I will just keep the current duplicate code.
I think a very good first step would be to do this first for tests.zig. This will also nicely inform what might be missing from any of the different lib.zig versions.
I am starting work on this today, and I think this is a great suggestion, thank you!
Currently each version of Lua/Luau that Ziglua supports has tests and bindings for that version. This results in a lot of duplicated code (which isn't too bad because Lua is a stable target). But as time has gone on, this leads to a lot of duplicated effort in the following cases
This is annoying enough that I think it is worth it to find a way to simplify things down to just one of each
ziglua.zig
andtests.zig
files.I attempted this in the past with
usingnamespace
"mixins", but it was really messy. I want to attempt this again, but this time using conditional compilation based on the target version of Lua.The text was updated successfully, but these errors were encountered: