top | item 42709444

(no title)

rmgk | 1 year ago

I 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)

discuss

order

Pay08|1 year ago

It is also strictly less powerful because of that, often needing to launch bash scripts instead of the programs directly.

rmgk|1 year ago

I 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|1 year 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|1 year ago

The 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.