4 ms·
The automatic naming of paths is a critical feature of Nix. Without it, Nix expressions can’t exist. One of the most remarkable features of Nix is that package
by soraminazuki 3y ago
The automatic naming of paths is a critical feature of Nix. Without it, Nix expressions can’t exist. One of the most remarkable features of Nix is that package build recipes, or derivations, in Nix speak, can be treated like any other value in a programming language. It’s possible to reuse and modify existing derivations in Nix expressions without causing conflicts. That’s only possible because different derivations are assigned different paths. If Nix copied GoboLinux and treated packages with differing build recipes as the same, it would lose its declarative and reproducible nature.
Also, there’s no actual use case for Nix store paths with the hashes stripped out. The actual path can easily be derived from whatever is at the root of the dependency. Things like Nix expressions, the result symlink, the system environment in /run/sw/current-system, and PATH. Those are “human readable.” From there, you can get the actual store paths. It doesn’t matter that they’re prefixed with a hash because they still have human readable names at the end, allowing you tell what they contain.
It’s similar to inspecting memory. You don’t want to start by examining raw bytes in memory dumps. It’s far more easier and meaningful to start by chasing variables instead.
- lproven 3y agoI think that you misunderstand me, and I suspect that you have not read my other comments in this thread. E.g. https://news.ycombinator.com/item?id=39539010 https://news.ycombinator.com/item?id=39539010 What I am saying is that choosing this flat directory store, one that is very hard for humans to read, parse and navigate, is on its own a major disincentive for many people. The traditional and lavishly-documented Unix filesystem layout is comforting and familiar to hundreds of thousands of people (at a very conservative estimate!) and throwing it away was a poorly-considered move that on its own will make many people refuse to even consider Nix and its kin. If a project decides to replace it then it needs multiple compelling reasons, and just "search paths will sort it" and "this keeps pathnames short" is not good enough. What I am suggesting is that if automatic directory name management (via hashes or whatever) were combined with a more human-readable tree, this type of tool would have a much better chance of success. Even if it were less efficient. Even if it were more work for the developers. The benefits of the Nix approach are only compelling to a relatively small number of people and the price is too high for many. That's why after over 20 years, adoption is minimal. That's why work continues on Debian and all the other traditional distros. That's why since Nix was invented in 2003 (AFAIK) we have had AppImage and Snap and Flatpak. Because this stuff is too hard for ordinary folks. This is why functional languages as a whole have made so little impact on mainstream computing. They bring great benefits for those smart enough to understand them, but for the rest of us, for ordinary dumb jocks like me, it's too hard. http://steve-yegge.blogspot.com/2010/12/haskell-researchers-announce-discovery.html http://steve-yegge.blogspot.com/2010/12/haskell-researchers-... The same goes for Lisp's prefix notation, and for Forth's and Postscript's postfix notation and Reverse Polish Notation in general. After coming up on 40 years in the industry, I am convinced that some of this stuff really does have compelling advantages, but it's not compelling enough which is why tens of $millions are being spent on inferior tools such as Flatpak. And under the hood, Flatpak uses Ostree, and Ostree uses Git, and TBH I reckon about 1% of 1% of the thousands of people using Git and anything related to it actually understand how it works. This kind of thing is just too complicated for ordinary minds. https://xkcd.com/1597/ https://xkcd.com/1597/ Computers are not for computer scientists. Computers should be for everyone. The goal of making this stuff easier to understand is more important than the goal of making it better in some theoretical way.