-
Notifications
You must be signed in to change notification settings - Fork 61
Description
// 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
const lua = b.dependency("lua", .{
.target = target,
.optimize = optimize,
});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 module
exe.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.