Hacker News new | ask | show | jobs
by raehik 2584 days ago
Perfect, exactly what I needed. Trying to make the switch to Guix from Arch Linux but my hardware is hopelessly unsupported. There's a guix-nonfree repo out there but I couldn't get wrap my head around the config (new to Scheme). Guix looks really, really cool.
2 comments

They could make it look slightly more friendly, with little things like reducing unnecessary punctuation characters. For example, this:

  (make-linux-libre
   %linux-libre-version
   %linux-libre-hash
   '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
   #:patches %linux-libre-5.1-patches
   #:configuration-file kernel-config)
Could be this:

  (make-linux-libre
   :version      linux-libre-version
   :hash         linux-libre-hash
   :list         (list "x86_64-linux"
                       "i686-linux"
                       "armhf-linux"
                       "aarch64-linux")
   :patches      linux-libre-5-1-patches
   :config-file  kernel-config)
Then it's easier to see that the semantics is actually familiar to you: it's just a call of function `make-linux-libre` with keyword arguments like `:version`.

Minus characters are parts of identifiers (like underscores in many other languages), parentheses delimit lists of things, and the first identifier in parentheses list is usually either a function name or a macro name.

If you want to invest half an hour into being able to read most Scheme code, you could skim the old R5RS paper, and skip the parts on first-class continuations, formal semantics, and `do`. https://schemers.org/Documents/Standards/R5RS/

On your first skim, also don't spend much time trying to understand R5RS `syntax-rules` -- it's neat, and worth learning someday, but there are now much more powerful and easier ways to extend syntax, especially in Racket.

Thanks. Your revised syntax looks so much cleaner. I'm interested in learning Guix because I was hoping the syntax would be cleaner than Nix's. From a dev ops perspective Nix/Guix is the way to go. To me, the syntax plays a great part in coming up to speed and trying new stuff without going back to the manual.

My understanding is that Guix is 7 years in the making (at least) so is there even a remote possibility that syntax revisions like the one above will be considered?

I don't know anything about Guix itself yet, but you could ask the developers.

Scheme is great as an imperative (or declarative) configuration language, because the language is super-powerful, yet small and elegant. So many configuration languages end up being ad-hoc.

You first have to specify the custom packages load path and then add the name of the package to your scheme system configuration.

For example:

You have a scheme file in /path/to/guix-custom which includes the declares linux-nonfree.

You run `export GUIX_PACKAGE_PATH=/path/to/guix-custom` and now guix will be able to find this package.

You use the module and include in the declaration

`(kernel linux-nonfree)`

PM and I will share my configuration :)