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 default name used by packages depending on this one. For// example, when a user runs `zig fetch --save <url>`, this field is used// as the key in the `dependencies` table. Although the user can choose a// different name, most users will stick with this provided value.//// It is redundant to include "zig" in this name because it is already// within the Zig package namespace.
.name="$",
Zig says that using the word zig in the package name is redundant. But is this actually helpful?
Let's say we rename it to lua. Then by default the dependency code would look like this in a build.zig
People are always welcome to rename things in the .zon file, but will they?
But with that, the module name is still ziglua, so the build file would continue as
// add the ziglua moduleexe.root_module.addImport("ziglua", lua.module("ziglua"));
Maybe this should be exe.root_module.addImport("lua", lua.module("lua"));?
But I really like naming my Lua.init() variable lua, and I don't want that to conflict. Not sure what to do here.
Lurking in Discord, it seems like ziglua is sometimes referenced as an example of how a Zig project is structured. This is probably because Zig doesn't have great docs and most of us are just looking at what everyone else is doing.
So
Should the package be named ziglua?
Should the module be named ziglua?
For clarity I believe the repo should be named ziglua. This makes it clear the purpose of the project and makes it searchable.
The text was updated successfully, but these errors were encountered:
I think there's a case for keeping the name ziglua: given the existence of pushAny and so forth, the project is now more than simply bindings to the C API that rename functions. Also, as far as I know you're not part of the lua.org organization, so keeping the name separate is useful for that reason too.
https://github.com/ziglang/zig/blob/2d888a8e639856e8cb6e4c6f9e6a27647b464952/lib/init/build.zig.zon#L2-L9
Zig says that using the word
zig
in the package name is redundant. But is this actually helpful?Let's say we rename it to
lua
. Then by default the dependency code would look like this in a build.zigPeople are always welcome to rename things in the
.zon
file, but will they?But with that, the module name is still
ziglua
, so the build file would continue asMaybe this should be
exe.root_module.addImport("lua", lua.module("lua"));
?But I really like naming my
Lua.init()
variablelua
, and I don't want that to conflict. Not sure what to do here.Lurking in Discord, it seems like ziglua is sometimes referenced as an example of how a Zig project is structured. This is probably because Zig doesn't have great docs and most of us are just looking at what everyone else is doing.
So
For clarity I believe the repo should be named ziglua. This makes it clear the purpose of the project and makes it searchable.
The text was updated successfully, but these errors were encountered: