by coldblues · 3y ago · 0 comments
On the other hand, Guile is not a DSL but a general purpose language or a Lisp (Scheme to be exact), so it's not actually a downside compared to a DSL in my view.
I myself am torn between these two. Nix community is larger and they have more packages. Guix, being a GNU project, obsessing over ""non-free"" sure won't help in its adoption. Even debian folks toned down their stance on this, why couldn't Guix do so too?
As a long time contributor to Guix I find that the "obsessing" is regularly done by others when talking about GNU. There's enough useful free software out there that needs packaging, and that's what I do. I don't need the extra headache of special snowflake licenses or custom restrictions.
For nonfree software that doesn't have a popular alternative I contribute to guix-science-nonfree. It's barely an inconvenience for users to expressly add another channel to their Guix installation.
Needing a channel was a huge inconvenience as you would often pull your channels and stuff would break, as guix was updated but non-guix wasn't. Managing channel manifests was a pain. Firefox would often be months out of date as well.
Moved to NixOS, didn't enable allowUnfree, and had an actually up to date and simple to maintain system. Flakes solves the channels problems too. I had put a lot of effort into making Guix work, but it just had too many usabiltity issues, and the policy on firefox was a major one.
[1] https://guix.gnu.org/manual/en/html_node/Miscellaneous-Servi...
Needing channels for non-free is a feature as the system will be pure by default and can make progress towards fully reproducible builds for all packages rather than having several blessed non-free blobs around that drain maintainance time.
For the record, I use linux-nonfree, amdgpu, iwlwifi, firefox, and steam.
[1]: https://github.com/SystemCrafters/guix-installer/releases
Not the best of circumstances, I know, but it works (plus if you really wanted to, they give the derivation details in the release notes so you could just spin up a Guix VM which runs fine with the default image and generate the image yourself).
As a regular Nix user and occasional Guix dabbler, I think you really can't go wrong either way. I feel that Guix often gets short shrift here on HN, but at the end of the day it's a really thoughtfully designed project with a capable community and great documentation.
No idea what "making NixOS compatible with other programming languages" is supposed to mean. On the face of it the phrase is, well, baffling. Would you care to elaborate?
This keeps getting asked and it's baffling to me. Any programming language can delay evaluation by wrapping values in thunks where that makes sense, so it seems odd to me to give so much importance to whether values are evaluated strictly or delayed by default.
Guix package definitions declare other package values as inputs, and evaluation of these inputs is in fact delayed.
Verbosity: in Guix we don't generally run shell snippets as part of a build; the build phases are compiled into a Guile builder script, so in the absence of helpful abstractions build phases do not generally have the conciseness of shell scripts. On the other hand abstractions are easily fashioned, so some things are more concise and clearer than the shell equivalent.
> This keeps getting asked and it's baffling to me. Any programming language can delay evaluation by wrapping values in thunks where that makes sense, so it seems odd to me to give so much importance to whether values are evaluated strictly or delayed by default.
At least in Haskell laziness increases composability.
I can't think of any examples in Nix, but maybe it's the same reason?
{ config, ... }:
{
systemd.services.foobar = {
enable = true;
serviceConfig.User = config.users.users.foobar.name;
# etc...
};
}
Another use case is being able to keep everything as plain values. For example, I can run `import <nixpkgs> { }` without evaluating all of `nixpkgs`. You can accomplish that in a language with eager evaluation by wrapping values in functions but I prefer the everything-is-a-value way.Of course, this is just a matter of preference. Like most Guix vs. Nix aspects, as far as I can tell.
Indeed. I was simply asking whether the macros used for programming Guix are lazy, how is that baffling?
That Nix can't tell what's a package and what's not is a hindrance for its user interface (e.g., it's hard to look up packages by name/version or to iterate over them) and for packagers (e.g., easy to end up with package definitions that don't follow the informal "schema").
(Note that Nix's laziness is not an unalloyed good either, for example it is notoriously difficult to debug. But let's limit ourselves to pure expressiveness for now)
As regards macros, Guile allows you to write your own macros in a pretty straight forward way that is just not the case in Nix
Which isn't fully baked, no, but here's hoping.
Does Guix have anything similar to Nix flakes yet?
nix run github:ggerganov/llama.cpp
Makes it really easy to switch versions, fork, patch or otherwise customize things.[0] - https://en.wikipedia.org/wiki/JSON#Syntax
[1] - Edit: more quotation marks, commas, and colons
Essentially quickly scanning over lisp code doesn't give me any inclination about the structure at all, which I think is very important. I admit I haven't written a ton of lisp so maybe that's the problem.
'(:firstName "John"
:lastName "Smith"
:isAlive t
:age 27
:address (:streetAdddress "21 2nd Street"
:city "New York"
:state "NY"
:postalCode "10021-3100")
:phoneNumbers ((:type "home"
:number "212 555-1234")
(:type "office"
:number "646 555 4597"))
:children ("Catherine"
"Thomas"
"Trevor")
:spouse nil)
...or, indented more like Wiki's JSON example: '(
:firstName "John"
:lastName "Smith"
:isAlive t
:age 27
:address (
:streetAdddress "21 2nd Street"
:city "New York"
:state "NY"
:postalCode "10021-3100"
)
:phoneNumbers (
(
:type "home"
:number "212 555-1234"
)
(
:type "office"
:number "646 555 4597"
)
)
:children (
"Catherine"
"Thomas"
"Trevor"
)
:spouse nil
) (package
...
(build-system gnu-build-system)
(arguments '(#:configure-flags '("--enable-silent-rules")))
(inputs (list gawk))
Looks like a list with name/value pairs, but it's not, that's just the (package)-macro making that thing behave that way. And it's all quite arbitrary, '#:configure-flags' there is a name/value list too, but constructed completely differently. And the next line with (inputs) constructs a list with (list) instead of with a ' quote, as otherwise the list would contain the symbol 'gawk' instead of the value.Scheme is basically: "Here is the a bunch of Lego, go build yourself a programming language". Other language have syntax that forces at least a minimum of consistency.