News for hackers. Stuff that matters.
Re:Show HN: Lux – a luxurious package manager for Lua by mikepurvis on Monday April 07, 2025 @05:16PM (#43616034)
Indeed. I'm glad for us to have learned Python's 20 year lesson on the dangers of an executable manifest.
Re:Show HN: Lux – a luxurious package manager for Lua by lenkite on Monday April 07, 2025 @11:46PM (#43618186)
The Zig language seems to have learned the lesson the other way though: https://ziglang.org/learn/build-system/
Re:Show HN: Lux – a luxurious package manager for Lua by seanw444 on Tuesday April 08, 2025 @12:00PM (#43623275)
Isn't build.zig.zon the equivalent of the manifest in that case though?
Re:Show HN: Lux – a luxurious package manager for Lua by lenkite on Tuesday April 08, 2025 @01:51PM (#43624553)
Sure, but a zon file is really just an anonymous zig struct.
Re:Show HN: Lux – a luxurious package manager for Lua by mikepurvis on Tuesday April 08, 2025 @02:08PM (#43624755)
With the disclaimer that I know nothing about zig, I will say that Nix's flake files follow an interesting pattern where the output section is evaluated under the regular Nix interpreter and can do anything, whereas the input section is evaluated under a far stricter mini-interpreter that prohibits everything other than basic strings and attrsets (dictionaries).

A flake.nix is certainly not packaging metadata, but I do know those input section restrictions do cause occasional confusion with users who think "ah, Nix code" and only realise afterward that it's really json in Nix syntax."

All that to say, if a thing is not evaluate-able, it's probably best to represent it in a different enough form that no one could mistake it for a thing that can be evaluated.