Earlier quoted context omitted.
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.
I know that's true, having heard it talked about a lot over the years. But why, though? What is it about Guile that made GNU pick it over CL or Scheme (or TCL or Lua or...)? NM, answered my own question. It’s literally Scheme.
The Shepherd 1.0.0 released
51–58 of 58 posts
Re: The Shepherd 1.0.0 released
#52Earlier quoted context omitted.
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 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…
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.
Re: The Shepherd 1.0.0 released
#53Taking 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"…
'("…/bin/ntpd"
"-n" "-c" "/…/…-ntpd.conf"
"-u" "ntpd" "-g")
Why isn't the configuration language mainly declarative, with executable Scheme only available other escape hatch to use as an exception rather than the rule?I don't want to worry about list versus quote in a configuration language, because they shouldn't be evaluation going on, or not by default.
Re: The Shepherd 1.0.0 released
#54Earlier quoted context omitted.
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…
It is also strictly less powerful because of that, often needing to launch bash scripts instead of the programs directly.
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.
Re: The Shepherd 1.0.0 released
#55Earlier quoted context omitted.
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…
> 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.
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.
Re: The Shepherd 1.0.0 released
#56Earlier quoted context omitted.
> 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.
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…
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")
Re: The Shepherd 1.0.0 released
#57Earlier quoted context omitted.
> NIH syndrome I would be using nonGuix if it booted on my machine (libre seemingly has its claws too deep), instead of Nix, precisely because Guix has far less NIH: Nix is homegrown everything. Guile was a pre-existing project (for both Guix and The Shepherd), for a pre-existing language family.
If you ever want to return to it, the nonguix ISO can be notoriously buggy. A better approach is to use the normal Guix ISO with an ethernet cable during installation and while setting up nonguix and your drivers.
Re: The Shepherd 1.0.0 released
#58Earlier quoted context omitted.
> 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.
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…
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.