Live data from Hacker News

Writing a Package Manager

antonz.org

61–70 of 106 posts

Re: Writing a Package Manager

#62
post #61

Why do we need a separate package manager for every programming language and every extensible library/app?

In theory nix can solve that, in practice is more ergonomic to leverage a language's native package manager even in nix.

Does using nix still make the sense it's meant to make if you use a language's native package manager?

Re: Writing a Package Manager

#64

Honestly pretty strange to write a package manager for sqlite and to use directories + json files to store the data instead of sqlite.

SQL not so good for tree structures. Recursive CTEs are pretty gnarly. Graphdb would be ideal.

You want to bring in a dependency to avoid writing one 8 line CTE?

Re: Writing a Package Manager

#65

Earlier quoted context omitted.

It's not wrong to depend on a single version, just suboptimal. Exhaustively testing every combination of dependencies with your project is infeasible for any non-trivial set of dependencies. The "is compatible with" relationship present in some package managers (e.g. ~= in pip) isn't guaranteed to work because packages can "lie" about their compatibility. Sure, it's better to have some kind of way for a piece of soft…

Why not just replace the "requires" semantics with "has passed tests with" and "has failed tests with" and let the host decide?

In general: no reason, I quite like your idea and think that it's useful. However, in the specific case of the blog post: because that's more complexity, which requires more effort.

I suspect that the author would have added in a more complex versioning/dependency system if he had more time/energy. But, given that he didn't, he had to make a choice about what features to include, and how much to flesh out the various systems.

A simple "depend on exact version" system is relatively easy to implement, and still (indirectly) supports users overriding the lockfile by manually editing it. A more complex (but flexible) system like pip's or yours would be more ideal from a user's perspective - the developer just needs to put in the time to implement.

However, I don't think that any of the above systems are wrong, unlike e.g. one that only allows you to specify a specific version in the lockfile, but then silently downloads "updates" to those dependencies in the background.

Re: Writing a Package Manager

#67
post #34

Wonderful post, how about using standard OCI to unify products? We have also been working hard recently on a package manager for configuring language KCL, which currently supports Git, OCI, and more.

What do you mean by OCI and KCL?

Re: Writing a Package Manager

#68
Source control is my package manager. Package managers as we usually think of them are syntax sugar and abstraction for the sake of abstraction

Working on a Linux distro that is one unified/generalized/normalized code base (with the help of AI/ML) and a model to sample and establish correct state from memory of the initial code base.

One way to think of it is like a game engine with action plans to allocate resources to recreate Firefox, for example. Not compile and run Firefox, but using *alloc() and free(), etc to establish the correct machine state to browse websites after learning what that state is in the abstract from Firefox’s code.

My thinking is many of our “truisms” in IT are outdated given modern machine performance and network reliability relative to the 80s and 90s when many of those “truisms” were defined.

Re: Writing a Package Manager

#69
post #63

Bit of a tangent here but what’s a pip/npm/cargo like package manager for C++? For example ‘pip install boost’? I’ve never worked it out for hobby projects and never worked with it commercially

Use Bazel.

I’ve heard a lot about Bazel but are there any good beginner tutorials? When I last looked it felt a little Nix-like (high learning curve to get through which I prefer to ignore for my tooling where possible)

Re: Writing a Package Manager

#70

Earlier quoted context omitted.

SQL not so good for tree structures. Recursive CTEs are pretty gnarly. Graphdb would be ideal.

You want to bring in a dependency to avoid writing one 8 line CTE?

The number of lines needed is not a good measure for gnarliness.

(To be fair, I don't know if gnarliness is measurable at all.)

Post reply on HN