175 points by sharpshadow 5 days ago | 56 comments
davexunit 5 days ago
NLnet has funded a really cool project to turn Shepherd into a distributed system that enables a fleet of Shepherds to cooperate. https://nlnet.nl/project/DistributedShepherd/
paroneayea 5 days ago
skulk 5 days ago
xelxebar 5 days ago
Guix documentation is top notch, and it's really nice having all that available locally as texinfo pages. For writing packages yourself, I've found the Guix source to be eminently more greppable than Nix, which eases the dev onramp.
Nix's daemon is definitely more performant than Guix's, so equivalent operations will usually be quite a bit slower in Guix, but on the whole I'd say that Guix's more cohesive design makes the system more pleasant to work with.
Happy to help if you have any specific questions!
skulk 4 days ago
qazxcvbnm 4 days ago
Pay08 4 days ago
(foo-configuration (bar-property baz-value) ...)
worik 5 days ago
I believe you
But what practical use is it?
I cannot tell.
doublerabbit 5 days ago
service manager.
Where by you can create a service of your own application in userland without needing to be PID 1 to execute the service. With all the bells and whistles of monitoring and trigger.
tmtvl 5 days ago
davexunit 5 days ago
danudey 5 days ago
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.
uludag 5 days ago
{
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.
yencabulator 5 days ago
ebilgenius 5 days ago
Pay08 4 days ago
rmgk 4 days ago
The systemd variant uses one of the universal DSLs for key-value pairs (key=value) and the universal DSL for calling programs (program name, space separated list of arguments).
The latter is even the same syntax that lisp uses for functions calls – thus I would argue the systemd config file looks more like a lisp program than the Guix version does.
As a person that has seen a reasonable amount of sexpression, this is what I would not bat an eye at:
(start /path/to/ntpd -n -c /etc/ntpd.conf -u ntpd -g)
Pay08 4 days ago
rmgk 3 days ago
If so, I fully agree, on the config being less powerful.
Maybe let me add to my original argument, because it does not seem to make it’s point well.
I think that it would be feasible (and worthwhile) to simplify the configuration structure while keeping Guile syntax, and have the complaint be a non issue. As opposed to keeping the semantic structure and just changing the syntax as the comment I replied to proposed.
bmacho 4 days ago
Yeah, don't do that. Both the program name, and the arguments can and do contain spaces. Do instead what every other languages do, that is, use a list of strings to invoke programs.
> The latter is even the same syntax that lisp uses for functions calls
No it's not.
rmgk 3 days ago
Choosing space for a very common thing in your language often makes sense, as you reduce the amount of visual elements. Thus space is often used to apply arguments to functions. Lisp and Haskell are common examples Though, you could argue that in Lisp it only is an application if it is within parenthesis.
bmacho 3 days ago
And programming languages that have variables, string type, and function calls do the opposite. In C, Python, JavaScript etc, in order to start a program you make a function call with a list of strings.
> Choosing space for a very common thing in your language often makes sense,
Not interpreting space separated things as strings but as keywords (built ins, variable names, literals) makes more sense for bigger programs.
kazinator 3 days ago
So (ls -l .foo) is a three element list of symbols in Common Lisp or Scheme, sure.
Symbols are not strings though; we don't necessarily want to use symbols this way. For one thing, they get interned. That means they stick around forever, or until explicitly uninterned. The symbols are memorized so that the next time they appear, the same object is returned (almost always implemented as a pointer to the same symbol).
String tokens use mandatory double quotes: ("ls" "-l" "
.foo")packetlost 5 days ago
Bootvis 5 days ago
blueflow 5 days ago
Having the shell taken out of the equation is what Lennart promised but never delivered.
n8henrie 5 days ago
I don't know lisp, but the idea of having each argument be part of a list (kind of like launchd's xml format) resonates with me.
teddyh 5 days ago
(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...>
mmstr 5 days ago
kkfx 5 days ago