Live data from Hacker News

Show HN: Brioche – A new Nix-like package manager

brioche.dev

21–30 of 90 posts

Re: Show HN: Brioche – A new Nix-like package manager

#21
post #2

Flakes definitely help with the giant megarepo annoyances of NixOS, though they're still a little irritating. If you are writing in a languages that doesn't hasn't had its packages directly integrated into the build system (like Python's has), it can be really irritating to do anything with them, since the `nix build` command disables network access and you therefore cannot use regular package manager. I'm doing a pr…

>`nix build` command disables network access Only if building with sandbox enabled. Can disable it if network access is required. Seems someone opened an issue asking[1] for granular permissions (explicit network restriction) but has been marked as stale. In same issue someone else has made comment providing an hybrid approach. Since you mentioned Julia, it's possible to build Julia environments (with arbitrary packa…

I didn’t realize that. I will give that a look.

Re: Show HN: Brioche – A new Nix-like package manager

#22
post #7

I'm very excited by all the attempts to replace Nix, but I don't think I'll be exploring this much deeper. In my opinion the issue with Nix is that the data model is not crisply defined -- it's there, but hidden under a lot of goop that is the Nix language itself and the various assumptions and baggage that goes with it. What I want is a primarily declarative syntax supporting a rich set of data structures, ideally a…

flox is the best thing I know of for articulating binary dependencies (language runtimes, etc.), which is probably the sweet spot for nix anyways at the moment (i.e. as opposed to trying to build everything "With the One [Tool] to [Replace] Them All"). flox uses nix for its backend, but has a simple TOML syntax and is properly humble about what it can do -- but killer at it -- as opposed to promising the world.

https://flox.dev

Re: Show HN: Brioche – A new Nix-like package manager

#23
post #18

Earlier quoted context omitted.

Agreed on all counts, especially the central issue with nix and the properties that I'd want out of a replacement. I think CUE ( https://cuelang.org/ ) is a perfect language for this.

Cue is fun, but already the unification example ( https://cuelang.org/docs/tour/basics/duplicate-fields/ ) shouts "footguns" to me :( TS is certainly excessively powerful though.

I don't think this would be a problem in practice. By default structs are "open" in cue, i.e. as long as matching fields unify, disparate fields just merge. There are also "closed" structs that allow creating a definition that fails to unify with fields not explicitly listed. https://cuelang.org/docs/tour/types/closed/

Re: Show HN: Brioche – A new Nix-like package manager

#24

Some of the oddities of the nix language are pretty useful for its domain. Recursive attribute sets, for instance, save a lot of headaches if you're trying to have only a single source of truth. Do you feel like these translate to typescript nicely? As somebody who knows nix but doesn't know typescript, I found myself looking for a rosetta stone page where I could look at two chunks of code that do the same thing, bu…

The syntax isn’t as clean but you can add property accessors to objects in JavaScript that accomplishes the same thing.

Re: Show HN: Brioche – A new Nix-like package manager

#25
post #18

Earlier quoted context omitted.

Agreed on all counts, especially the central issue with nix and the properties that I'd want out of a replacement. I think CUE ( https://cuelang.org/ ) is a perfect language for this.

Cue is fun, but already the unification example ( https://cuelang.org/docs/tour/basics/duplicate-fields/ ) shouts "footguns" to me :( TS is certainly excessively powerful though.

What foot guns are you seeing specifically?

Re: Show HN: Brioche – A new Nix-like package manager

#26
post #7

I'm very excited by all the attempts to replace Nix, but I don't think I'll be exploring this much deeper. In my opinion the issue with Nix is that the data model is not crisply defined -- it's there, but hidden under a lot of goop that is the Nix language itself and the various assumptions and baggage that goes with it. What I want is a primarily declarative syntax supporting a rich set of data structures, ideally a…

I think that declarative configuration languages scratch the itch of a lot of developer brains, but in practice it doesn’t really matter and using more familiar languages is a huge benefit to devex that shouldn’t be overlooked if the goal is to be mainstream. Yes, it requires more discipline on the reviewer front not to create abstractions that are too powerful/footgun-y, but it’s totally possible to write clear, declarative code in a “real” programming language without artificial constraints.

Re: Show HN: Brioche – A new Nix-like package manager

#27
post #7

I'm very excited by all the attempts to replace Nix, but I don't think I'll be exploring this much deeper. In my opinion the issue with Nix is that the data model is not crisply defined -- it's there, but hidden under a lot of goop that is the Nix language itself and the various assumptions and baggage that goes with it. What I want is a primarily declarative syntax supporting a rich set of data structures, ideally a…

I think that declarative configuration languages scratch the itch of a lot of developer brains, but in practice it doesn’t really matter and using more familiar languages is a huge benefit to devex that shouldn’t be overlooked if the goal is to be mainstream. Yes, it requires more discipline on the reviewer front not to create abstractions that are too powerful/footgun-y, but it’s totally possible to write clear, dec…

I'm not so worried about my disciplined coworker who just wants to help. If we were all reviewing his code I'd agree with you.

The people I want to help are those who are unknowingly reviewing malicious commits, and I think that declarative configuration languages have a part to play there.

Re: Show HN: Brioche – A new Nix-like package manager

#28

Earlier quoted context omitted.

I think that declarative configuration languages scratch the itch of a lot of developer brains, but in practice it doesn’t really matter and using more familiar languages is a huge benefit to devex that shouldn’t be overlooked if the goal is to be mainstream. Yes, it requires more discipline on the reviewer front not to create abstractions that are too powerful/footgun-y, but it’s totally possible to write clear, dec…

I'm not so worried about my disciplined coworker who just wants to help. If we were all reviewing his code I'd agree with you. The people I want to help are those who are unknowingly reviewing malicious commits, and I think that declarative configuration languages have a part to play there.

This is solved in tools like Pulumi by having a declarative and auditable build artifact as an intermediate step that can be diffed. This seems to solve a lot of the security issues (and is generally a good idea anyway).

Re: Show HN: Brioche – A new Nix-like package manager

#29

Earlier quoted context omitted.

I'm not so worried about my disciplined coworker who just wants to help. If we were all reviewing his code I'd agree with you. The people I want to help are those who are unknowingly reviewing malicious commits, and I think that declarative configuration languages have a part to play there.

This is solved in tools like Pulumi by having a declarative and auditable build artifact as an intermediate step that can be diffed. This seems to solve a lot of the security issues (and is generally a good idea anyway).

I would still prefer to debug terraform (which is a fair bit more declarative) rather than pulumi

Re: Show HN: Brioche – A new Nix-like package manager

#30

Some of the oddities of the nix language are pretty useful for its domain. Recursive attribute sets, for instance, save a lot of headaches if you're trying to have only a single source of truth. Do you feel like these translate to typescript nicely? As somebody who knows nix but doesn't know typescript, I found myself looking for a rosetta stone page where I could look at two chunks of code that do the same thing, bu…

I've been asked about overrides and attributes a lot! That was one of the sacrifices I had to make to go with a more traditional language, so it's definitely a negative point compared to Nix. That said, I'm hoping to have some conventions and features that will cover _most_ of the use-cases that overrides give you, but that's definitely still future work at this point and I probably won't be able to cover everything overrides do

And yep, I think having a "Brioche for Nix users" guide makes a lot of sense, although it's not the first time that question so I'll probably stand up a first-pass version of it sooner rather than later (my Nix skills are also pretty rusty-- I'll need to brush up a bit first before I write it!)

Post reply on HN