Re: A friendlier API for operating-system declarations

2024-03-01 Thread Hartmut Goebel
Hi, Am 19.02.24 um 23:25 schrieb antlers: (define (os-with-yubi parent users*) (modify-record parent (groups -> (cons (user-group (name "plugdev")) <>)) (users -> (map (lambda (user) (if (member (user-account-name user) user

Re: A friendlier API for operating-system declarations

2024-02-26 Thread Liliana Marie Prikler
Am Sonntag, dem 25.02.2024 um 13:27 -0800 schrieb antlers: > Thanks for the detailed response c: > > The blocker is that AFAIK we can't tell if a record-field was defined > as thunk-ed or delay-ed outside of the expansion of the > `define-record-type*' form that defines it, nor programatically > a

Re: A friendlier API for operating-system declarations

2024-02-25 Thread antlers
Thanks for the detailed response c: The blocker is that AFAIK we can't tell if a record-field was defined as thunk-ed or delay-ed outside of the expansion of the `define-record-type*' form that defines it, nor programatically access it's getter/setter (the pair `(guix records)` defines, which acco

Re: A friendlier API for operating-system declarations

2024-02-25 Thread Liliana Marie Prikler
Am Sonntag, dem 25.02.2024 um 10:49 -0800 schrieb antlers: > > 1.) It leaks `(guix records)`'s thunked/delayed field abstraction to > the end-user, which will confuse and regularly bite absolutely anyone > who tries to use it. > > 2.) Ideally we'd check that modified fields exist at compile-time.

Re: A friendlier API for operating-system declarations

2024-02-25 Thread antlers
> I don't believe that the syntax achieves its goals without this > mechanism I just realized my example doesn't actually include a use of recursive cut after all (whoops), and finding only 2 uses in my code-base, am open to considering SRFI-26 sufficient. This helps somewhat, but was not the bloc

Re: A friendlier API for operating-system declarations

2024-02-25 Thread antlers
> That looks like a nice syntax indeed. Is the code behind it small > enough to include it in (guix records)? Small enough? Yes (<100 LOC, inc. a handful of comments and tests). Suitable? No, I introduced it as "moderately-cursed" for a reason >u< But I appreciate the sentiment c: 1.) It leaks

Re: A friendlier API for operating-system declarations

2024-02-25 Thread Liliana Marie Prikler
Am Montag, dem 19.02.2024 um 14:25 -0800 schrieb antlers: > ``` > (define (os-with-yubi parent users*) >   (modify-record parent >     (groups -> (cons (user-group (name "plugdev")) <>)) >     (users  -> (map (lambda (user) >   (if (member (user-account-name user) >

Re: A friendlier API for operating-system declarations

2024-02-24 Thread antlers
Hi! Just wanted to say that I really admire your take on end-user service configuration in the Beaver Labs channel. I gravitated towards composing functions over `operating-systems` myself, though my config is probably only ""notable"" for the moderately-cursed `modify-record` macro that I use

Re: A friendlier API for operating-system declarations

2024-02-24 Thread antlers
Oh, thank you! Don't study too closely-- I'm quite the novice myself, having come upon your work in search of better solutions, and the drawbacks I described are rather notable; but I appreciate that you see what I was going for. (I'd be much happier with it if I could interrogate `(guix record)`

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-12-09 Thread Ludovic Courtès
Hello! Edouard Klein skribis: > Thank you Liliana and Attila for the swift and actionable feedback :) > > Below is a revised proposition. > > Here is a minimal working example of an os declaration: > --mwe.scm--- > (use-modules > (beaver system) > (beaver functional

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-12-01 Thread Michal Atlas
Hello, just FTR, i don't think that the guix codebase is too bad in this regard. It's not bad for the slightly initiated, which does still take time, and I think that front would perhaps benefit from some attention. My main take away from this was that what I liked mostly about the BeaverLab

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-30 Thread Attila Lendvai
> > the downside of generating countless macros is that they won't show up > > in backtraces, and they cannot be found when grep'ping the codebase, > > and as such make the codebase much less approachable. > > > Reading your words really helped me feel that I'm not alone. You more or > less summa

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-29 Thread Development of GNU Guix and the GNU System distribution.
Hi Attila, On Wed, Nov 29 2023, Attila Lendvai wrote: > i agree. in my experience, it's good practice in general to try to > make a functional API as convenient as possible, and if that is still > too verbose or cumbersome, only then add a thin layer of syntactic > abstractions that expand to cod

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-29 Thread Attila Lendvai
> lines of code. I think hyper-focusing on syntax to make services > "nicer" might be the wrong approach here: You could greatly reduce the > complexity by making them procedures instead of syntax and still keep > most of the configuration readable to a great extent. i agree. in my experience, it

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-27 Thread Liliana Marie Prikler
Am Sonntag, dem 26.11.2023 um 21:46 +0100 schrieb Edouard Klein: > > Liliana Marie Prikler writes: > > >     (instantiate nginx) > > I do wish you spelled out service.  Also, instantiate takes as much > > characters to type as add-service. > > > > Done, see below. I was worried about the parony

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-26 Thread Edouard Klein
Liliana Marie Prikler writes: >>     (instantiate nginx) > I do wish you spelled out service. Also, instantiate takes as much > characters to type as add-service. > Done, see below. I was worried about the paronymy between add-service and add-services which already exists. I defer to you and y

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-26 Thread Michal Atlas
Hello guix, I'll chime in because I've been playing around with this kind of thing in my channel [1] for a bit now and perhaps some of the ideas will be deemed useful. (service+ OS SERVICE [CONF]) (service- OS SERVICE) (modify-service OS SERVICE UPDATE) I found that defining a functional A

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-26 Thread Liliana Marie Prikler
Am Sonntag, dem 26.11.2023 um 17:49 +0100 schrieb Edouard Klein: > Thank you Liliana and Attila for the swift and actionable feedback :) > > Below is a revised proposition. > > Here is a minimal working example of an os declaration: > --mwe.scm--- > (use-modules >  (be

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-26 Thread Edouard Klein
Thank you Liliana and Attila for the swift and actionable feedback :) Below is a revised proposition. Here is a minimal working example of an os declaration: --mwe.scm--- (use-modules (beaver system) (beaver functional-services) (gnu packages version-control) (gnu

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-25 Thread Attila Lendvai
> (service+ OS SERVICE [CONF]) > (service- OS SERVICE) > (modify-service OS SERVICE UPDATE) what would the benefit of generating multiple macros for each service compared to the above functional API (with 3-4 elements altogether)? i could be missing something here, but it seems to be precious l

Re: Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-24 Thread Liliana Marie Prikler
Am Freitag, dem 24.11.2023 um 22:43 +0100 schrieb Edouard Klein: > Dear Guixers, > > Here is a quick status update on my proposition to expose composable > functions to change operating-system declarations. > > Thank you all for the feedback you gave me :) It's very nice to not > be talking in th

Syntactic Diabetes (was Re: A friendlier API for operating-system declarations)

2023-11-24 Thread Edouard Klein
Dear Guixers, Here is a quick status update on my proposition to expose composable functions to change operating-system declarations. Thank you all for the feedback you gave me :) It's very nice to not be talking in the void. After Liliana opined that these functions should not put too much burd

Re: A friendlier API for operating-system declarations

2023-05-18 Thread antlers
Anecdotally, my personal configurations are built out of composable operating-system transformers that add packages, services, etc. through trees of inherited records. That's fairly straightforward for eg. adding packages, but becomes more complicated when you consider modifying service configurat

Re: A friendlier API for operating-system declarations

2023-05-18 Thread Edouard Klein
Hi ! Ludovic Courtès writes: > Hi Edouard, > > Edouard Klein skribis: > >> For my clients and my own use, I use a layer on top of operating-system >> declarations in which I create functions that take an os as a first >> argument, and return an os. >> >> With the help of the handy -> macro, I ca

Re: A friendlier API for operating-system declarations

2023-04-13 Thread Ludovic Courtès
Hi Edouard, Edouard Klein skribis: > For my clients and my own use, I use a layer on top of operating-system > declarations in which I create functions that take an os as a first > argument, and return an os. > > With the help of the handy -> macro, I can chain them, thus allowing an > easy stac

Re: A friendlier API for operating-system declarations

2023-03-23 Thread Liliana Marie Prikler
Am Donnerstag, dem 23.03.2023 um 09:06 +0100 schrieb Edouard Klein: > After a few months of experience, and positive feedback from my > clients, my question to you guys is: would you be interested in > mainlining this, or should I keep my development efforts separate in > my channel ? Having just d

Re: A friendlier API for operating-system declarations

2023-03-23 Thread Edouard Klein
Hi Josselin, Josselin Poiret writes: > [[PGP Signed Part:Undecided]] > Hi Edouard, > > Edouard Klein writes: > >> #+begin_src scheme >> (-> >> (minimal-ovh "ssh-rsa AAASomethingSomething== root@minimal-ovh") >> (http-static-content "sub2.example.com" #:to-dir "/srv/sub2") >> (http-static-con

Re: A friendlier API for operating-system declarations

2023-03-23 Thread Josselin Poiret
Hi Edouard, Edouard Klein writes: > #+begin_src scheme > (-> > (minimal-ovh "ssh-rsa AAASomethingSomething== root@minimal-ovh") > (http-static-content "sub2.example.com" #:to-dir "/srv/sub2") > (http-static-content "sub1.example.com" #:to-dir "/srv/sub1/") > (add-services my-db)) > #+end_src

A friendlier API for operating-system declarations

2023-03-23 Thread Edouard Klein
Dear Guixers, For my clients and my own use, I use a layer on top of operating-system declarations in which I create functions that take an os as a first argument, and return an os. With the help of the handy -> macro, I can chain them, thus allowing an easy stacking of multiple "roles" or "funct