Live data from Hacker News

The Shepherd 1.0.0 released

guix.gnu.org

1–10 of 58 posts

Re: The Shepherd 1.0.0 released

#2
Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write.

e.g. instead of systemd's simple:

    Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g
We have this mess:

    #:start (make-forkexec-constructor
           (list "…/bin/ntpd"
                 "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd" "-g")
           #:log-file "/var/log/ntpd.log")
They say you don't need to be an expert on guile scheme to build a service file, but it does seem as though you need to know things like what `'(ntpd)` means, which I assumed was some kind of identifier literal, and it seems to be what's called a 'data literal' in scheme, but I had to google to discover that since the actual guile scheme documentation didn't seem to explain that syntax at all.

I get that there are benefits to being able to do more advanced scripting in a service file, but this seems like a classic example of programmers writing things for programmers and not for users (or at least, not for users who don't 'get it').

Going to chalk this up as another 'GNU reimplemented something badly because of NIH syndrome' incident and move on.

Re: The Shepherd 1.0.0 released

#4
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

> the actual guile scheme documentation didn't seem to explain that syntax at all.

  (quote data)
  'data
Quoting is used to obtain a literal symbol (instead of a variable reference), a literal list (instead of a function call), or a literal vector. ' is simply a shorthand for a quote form. For example,

  'x                   ⇒ x
  '(1 2 3)             ⇒ (1 2 3)
  '#(1 (2 3) 4)        ⇒ #(1 (2 3) 4)
  (quote x)            ⇒ x
  (quote (1 2 3))      ⇒ (1 2 3)
  (quote #(1 (2 3) 4)) ⇒ #(1 (2 3) 4)
Note that an application must not attempt to modify literal lists or vectors obtained from a quote form, since they may be in read-only memory.

— https://www.gnu.org/software/guile/manual/html_node/Expressi...>

Re: The Shepherd 1.0.0 released

#5
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

I vaguely learned lisp years ago and i already prefer the guile scheme over systemd - guile correctly takes an argument vector instead of a command string which needs to be split using some obtuse shell quoting rules.

Having the shell taken out of the equation is what Lennart promised but never delivered.

Re: The Shepherd 1.0.0 released

#6
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

The system is integrated into Guix, so makes sense to use s-exp for the configuration.

Systemd has done things that previously were trivial very difficult. I would like to know how it fares in that arena. The syntax can just be learned.

Re: The Shepherd 1.0.0 released

#7
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

I think this may be just due to unfamiliarity. Like, if that mess you shared was written as follows:

  {
    start: makeForkexecConstructor(["…/bin/ntpd", "-n", "-c", "/…/…-ntpd.conf", "-u", "ntpd", "-g"]),
    logFile: "/var/log/ntpd.log"
  }
this wouldn't bat an eye. Even though I've never used Guile, just familiarity with Elisp makes that example pretty straightforward. Lisp-adjacent people would all pretty quickly grok this I presume.

And I think it's also hard to claim that one is better than the other. I personally have gotten my feet wet with Guix and I would love the time to become more familiar it.

Re: The Shepherd 1.0.0 released

#8
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

You don't have to be an expert, but knowing the basics of Lisp helps. The full definition of the example "ntpd" service is clear to read.

> the actual guile scheme documentation didn't seem to explain that syntax at all

It does, here: https://www.gnu.org/software/guile/manual/html_node/Expressi...

It's a basic concept of Lisp. Everything is evaluated, unless quoted. Code is data is code!

Re: The Shepherd 1.0.0 released

#9
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

Guile has been the scripting language of choice for GNU before the Internet was called Internet. It hasn't even been disliked, it's been simply ignored, for the most part.

Re: The Shepherd 1.0.0 released

#10
post #8
post #2

Taking a quick look at this, the first thing I notice is that the configuration file syntax is obtuse and nigh-illegible unless you already know what things are, and even then it's cumbersome and looks frustrating to write. e.g. instead of systemd's simple: Exec=/path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g We have this mess: #:start (make-forkexec-constructor (list "…/bin/ntpd" "-n" "-c" "/…/…-ntpd.conf" "-u" "ntpd"…

You don't have to be an expert, but knowing the basics of Lisp helps. The full definition of the example "ntpd" service is clear to read. > the actual guile scheme documentation didn't seem to explain that syntax at all It does, here: https://www.gnu.org/software/guile/manual/html_node/Expressi... It's a basic concept of Lisp. Everything is evaluated, unless quoted. Code is data is code!

> Code is data is code!

Which nowadays is 'yaml is code is yaml is code is yaml' in the devops world. The wheel turns.

Post reply on HN