6 ms·
I think this may be just due to unfamiliarity. Like, if that mess you shared was written as follows: { start: makeForkexecConstructor(["…/bin/ntpd", "-n
by uludag 2y ago
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.
- packetlost 2y agoEh, I'm a Schemer (not Guile though) but the above is dramatically less readable and, at a glance, understandable than the equivalent systemd .target file. The problem with Lisps (but especially Schemes) is there's magic everywhere that makes no sense without having a sizeable context of the program you're working in.
- Bootvis 2y agoIMO in this example there seems too be to little magic.
- yencabulator 2y agoI would definitely bat an eye at "make fork exec constructor", regardless of what syntax sugar you sprinkle on that abomination.
- ebilgenius 2y agoWhile I agree it's hard to claim one is outright better than the other and there are a lot of factors that go into it, I do feel it's important to toss my chip in as someone who's not familiar with Lisp, Scheme, or any other functional language that I find it's syntax and layout particularly difficult to parse, let alone get started with compared to say, the INI-inspired systemd conf files. I can detail why but the mere fact that I'd have to learn an entire functional programming language (no matter how "easy/simple" it's claimed to be) to be able to competently edit a service file is a huge immediate turn-off for me.
- Pay08 2y agoThis is very basic Scheme syntax (plus Guile's keyword argument extension), nothing advanced and definitely not all of Scheme.
- rmgk 2y agoI don’t think this is about lisp syntax. 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 2y agoIt is also strictly less powerful because of that, often needing to launch bash scripts instead of the programs directly.
- rmgk 2y agoI understand this as systemds config being less powerful than using Guile? 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 2y ago> and the universal DSL for calling programs (program name, space separated list of arguments). 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 2y agoThe way that this syntax (see bash, zsh, fish, etc) usually work is that these lists are separated by spaces. You can still quote arguments if they contain spaces (or escape the spaces). 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.