Hacker News new | past | comments | ask | show | jobs | submit login

There is Guix, which replaces the Nix language with Scheme, but which has some limitations related to a smaller user base, e.g. a smaller package collection.

Replacing the language requires duplicating all the work that went into Nix, to reach parity, so it is not easy.




> Replacing the language requires duplicating all the work that went into Nix, to reach parity, so it is not easy.

That seems like a design flaw in Nix, there's no reason the data model should be so tightly coupled to the scripting implementation that you can't reuse packages written in a different language.


There is no technical barrier against doing that. But much of the power and flexibility in nixpkgs arises from the nix language, not the data model (which is comparatively simple).

For example, see zb: https://www.zombiezen.com/blog/2024/09/zb-early-stage-build-...

Using a different language to depend on packages derived from .nix would be very much akin to depending on a docker image whose Dockerfile you can not inspect.


> Using a different language to depend on packages derived from .nix would be very much akin to depending on a docker image whose Dockerfile you can not inspect.

Speaking of Docker images and Dockerfiles, that's actually a real-world example of how you can achieve this kind of effect without relying on a specific language. Ironically, you can use Nix to build Docker images; there's a bunch of other alternative builders (e.g. Kaniko, Buildah); you can also just stitch together some files&metadata into tarballs, and then 'docker import' it.

Nix or Guix are of course much more powerful and expressive than Docker images, but there's always a cost to complexity.


That sounds like a design flaw in the data model if the flexibility exists at a higher level.


What would a better design look like?


One where the "power and flexibility" of nixpkgs is encoded in the data model?

If there is something that can be done in the nix language that can't be expressed in the underlying model that needs to be used by another frontend then it should be represented in the underlying model so another frontend can use it.

To put it another way, if you're designing a client-server model where there may be multiple client implementations you don't bake big chunks of the implementation into the clients, you provide it in the server interfaces and data types.


Okay, but... how? You can't serialize a function or a closure very easily. I'm unaware of any language which attempts to do so.

Not having functions as values (true of pretty much any serialization scheme I've ever seen) makes serialized data structures strictly less powerful than data structures in code.

> that needs to be used by another frontend

I don't think this was ever a goal of Nix. But if it was, well, you would end up with something considerably less powerful for the reasons I stated.


The biggest limitation IMO it's that they are HPC-centric, not caring the desktop, which is the was to allow more people discovering a distro. Also the lack of a proper zfs and lvm/mdraid/luks support it's a big showstopper.


IIRC guix started off by being compatible with nix package derivations, but they broken it (i also may remember incorrectly).

If nothing changed, they also have a strong ideological drive and funny support any non-free software.


What is a "package derivation"? Packages and derivations are two different things in Guix.

Also, Guix supports proprietary software just fine. It's just not in the main official repo. But there are other repos that have it, e.g. nonguix.


Scheme is so much worse. It has so much repetition and is so much more verbose for no reason.


A macro-capable lisp means that this isn't permanently or definitionally true, even if it is today - which is pretty subjective.

https://www.gnu.org/software/guile/manual/html_node/Macros.h...

Racket is IMO a pretty compelling environment for prototyping DSLs because of how malleable it can be, so I think the ceiling for ergonomics can be pretty high.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: