Guix with Wisp (example)

Guix

Guix is the functional package manager from the GNU project. It currently uses Scheme as implementation. A package definition looks like this:

(define-public which
  (package
    (name "which")
    (version "2.20")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://gnu/which/which-"
                            version ".tar.gz"))
        (sha256
          (base32
            "1y2p50zadb36izzh2zw4dm5hvdiydqf3qa88l8kav20dcmfbc5yl"))))
    (build-system gnu-build-system)
    (home-page "https://gnu.org/software/which/")
    (synopsis "Find full path of shell commands")
    (description
      "which is a program that prints the full paths of executables on a
system.")
    (license gpl3+)))

And I must admit, that the parens make this look pretty alien to newcomers.

Guix-JS

So currently the Guix developers play with switching to Javascript. Then the packages would look like this:

 {
     "name": "which",
     "version": "2.20",
     "source": {
       "origin": {
         "method": "url-fetch",
         "uri": "mirror://gnu/which/which-" + 
                           version + ".tar.gz",
         "sha256": 
           base32("1y2p50zadb36izzh2zw4dm5hvdiydqf3qa88l8kav20dcmfbc5yl"),
       },
     },
     "build-system": "gnu-build-system",
     "home-page": "https://gnu.org/software/which/",
     "synopsis": "Find full path of shell commands",
     "description":
      "which is a program that prints the full paths of executables on a
system.",
     "license": "gpl3+"
 }

And to me this is even more alien than the scheme-version and much less readable than ebuild definitions in Gentoo - which are written in bash.

(note that this might not be completely correct. I adapted the example from the presentation on Guix for Fosdem 2014 (page 29) to fit the real which package in my guix store)

Wisp

Wisp is a preprocessor for Lisp-like languages which allows leaving out most parentheses. With it the same package definition would look like this:

define-public which
    package
      name "which"
      version "2.20"
      source
          origin
              method url-fetch
              uri (string-append "mirror://gnu/which/which-"
                                  version ".tar.gz")
              sha256
                  base32
                    . "1y2p50zadb36izzh2zw4dm5hvdiydqf3qa88l8kav20dcmfbc5yl"
      build-system gnu-build-system
      home-page "https://gnu.org/software/which/"
      synopsis "Find full path of shell commands"
      description
        . "which is a program that prints the full paths of executables on a 
  system."
      license gpl3+

This looks much less alien than standard scheme and much less busy than the Javascript example.

So rather than succumbing to the currently popular language (which is already under attack by Dart and X-to-JS-compilers), I would prefer a solution which uses the tried and true Lisp: The one group of languages which survived for over ten years without breaking its basic structure (C++ does not count…).

Note that you can also use the above package definition with SRFI-110 (project readable).

Summary

So, why drop Scheme for something less readable, when there are ways to make Scheme more welcoming without giving up its power and beauty?

Oh, wait…

looks at the date

ARGL, Aprils fool!

You got me good there ☺

But at least that made me write how the package would look with wisp or readable. I wanted to do that for quite some time ☺

Author: Arne Babenhauserheide

Created: 2014-04-01

Emacs 24.3.1 (Org mode 8.2.5h)

Validate