From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Profiles/manifests-related command line interface enhancements Date: Sat, 23 Nov 2019 18:10:22 +0100 Message-ID: <87mucm4iyp.fsf@gnu.org> References: <87mudrxvs8.fsf@ambrevar.xyz> <87mudd59ho.fsf@gnu.org> <877e4glyc3.fsf@ambrevar.xyz> <87v9rxx8ri.fsf@gnu.org> <87d0e4oy51.fsf@ambrevar.xyz> <878sop6icq.fsf@gnu.org> <87d0drscng.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35888) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYYvR-0000qG-Qp for guix-devel@gnu.org; Sat, 23 Nov 2019 12:10:27 -0500 In-Reply-To: (Konrad Hinsen's message of "Sun, 17 Nov 2019 11:44:55 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Konrad Hinsen Cc: guix-devel@gnu.org Howdy! Konrad Hinsen skribis: >> I=E2=80=99d like to think that writing Guile declarations for the OS con= fig, >> manifest, etc. is not just for =E2=80=9Cpower users=E2=80=9D. After all= people, or >> rather =E2=80=9Ccomputer-savvy=E2=80=9D people in a broad sense, write J= SON, YAML, >> custom config files etc. routinely, and I don=E2=80=99t think the typica= l config >> we propose is any =E2=80=9Charder=E2=80=9D. You may say I=E2=80=99m a d= reamer, but I=E2=80=99m not the >> only one. =F0=9D=85=9E=F0=9D=85=9F ;-) > > The problem with powerful formal languages (read: Turing-complete) is > not writing, but (1) debugging and (2) reading. Yes and no. Guile has a debugger, whereas XML/JSON/YAML don=E2=80=99t. As= for reading, it=E2=80=99s subjective, but I don=E2=80=99t think a full-blown la= nguage is necessarily harder to read. (define lst (list 1 2 3)) lst =3D [1, 2, 3] lst: - 1 - 2 - 3 The goal for Guix was to have the =E2=80=98package=E2=80=99 and =E2=80=98op= erating-system=E2=80=99 forms, for instance, look exactly like what you=E2=80=99d write in JSON etc= ., only with a different syntax. > 1. Writing a manifest file in Guile is no harder than writing a list > in YAML or whatever. But leave out the closing quote behind a > package name, and you will get an error message that will make > no sense to someone unfamiliar with the *complete* Scheme syntax. > For a small and simple file, you can usually spot the problem by > inspection (i.e. without the error message), but for more complex > files, it makes sense to use a more constrained language in order > to provide better error reporting. Error-reporting is tricky, but it=E2=80=99s tricky also (perhaps even more!) when parsing YAML. I agree there=E2=80=99s room for improvement in Guile in that area, but it= =E2=80=99s not that bad either if you compare to error reporting with most YAML, JSON, etc. libraries. Also Guile can report errors about semantics. > BTW, the Racket team makes that point to argue for their rather > complex macro system. It takes much longer to master than traditional > Lisp or Scheme macros, but it supports writing macros with error > reporting that makes sense to someone who didn't read the macro code. =E2=80=98syntax-parse=E2=80=99 is wonderful for that, I agree. > 2. Power users will always write code in powerful languages that exceed > what less advanced users can deal with. And since power users are not > necessarily benevolent, this creates a trust issue for the less > advanced ones. Good point. I tend to (naively?) view it the other way around: that it gives people an incentive to try and write actual code rather than mere declarations. > For a long version of these arguments, see > https://hal.archives-ouvertes.fr/hal-01966145/document Interesting! The conclusion you seem to draw is that embedded DSLs as found in Racket fit the bill, and to me, that=E2=80=99s pretty much what we= =E2=80=99ve been trying to do with Guix as well, no? What do we disagree on, actually? :-) Thanks again for your feedback! Ludo=E2=80=99.