guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Profiles/manifests-related command line interface enhancements


From: Konrad Hinsen
Subject: Re: Profiles/manifests-related command line interface enhancements
Date: Mon, 25 Nov 2019 12:06:16 +0100

Hi Ludo,

I'll start from the end:

> What do we disagree on, actually?  :-)

This:

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

I'd say we should encourage people to write declarations as much as
possible and resort to executable code only when declarations become
too messy. As a corollary, we should support most configuration-style
use cases with suitable declarative forms, much like these:

> The goal for Guix was to have the ‘package’ and ‘operating-system’
> forms, for instance, look exactly like what you’d write in JSON etc.,
> only with a different syntax.

For better illustration, I'll try to rewrite my own manifests in the
way I'd like to be able to write them. That's probably more useful
than theory (a tough statement to make for a theoretician ;-)

The main reason why I want to see more declarative style is:

>> 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’t.  As for
> reading, it’s subjective, but I don’t think a full-blown language is
> necessarily harder to read.

It's harder to read because you need to understand the language's
execution model if there is one. YAML etc. don't, there is nothing
but literals. Which is also why they don't need a debugger.

>   (define lst (list 1 2 3))
>
>   lst = [1, 2, 3]

Fine. But then a power user comes along and writes

   (define lst (cons* 1 2 '(3)))

That may be bad style, but as a reader I have to be able to deal with it
nevertheless. And bad style may in fact serve to obfuscate evil
intentions.

> Interesting!  The conclusion you seem to draw is that embedded DSLs as
> found in Racket fit the bill, and to me, that’s pretty much what we’ve
> been trying to do with Guix as well, no?

Indeed, just not enough for my taste!

Cheers,
  Konrad.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]