Subject: Re: [PATCH v2 04/13] gnu: Add Zuo.

From: Liliana Marie Prikler <[email-masked]>
Date: Thu, 11 Aug 2022 17:34:59 +0200

Hi,

Am Donnerstag, dem 11.08.2022 um 10:00 -0400 schrieb Philip McGrath:
> 
> > If we expect to maintain zuo split from racket, I'd rather go with
> > https://github.com/racket/zuo and git-version.
> 
> I mean, I don't think it's profoundly essential, but I've been using
> it for the last four months. I don't see any harm in leaving the
> level of indentation there so it can be used more easily if it is
> needed or wanted.
> 
> Building from https://github.com/racket/zuo would basically never be
> useful. It is generated intermittently from
> https://github.com/racket/racket using `git subtree`.
I don't think that matters much in the grand scheme of things (pun
intended).  Rather, having such subtrees available is beneficial in and
of itself, because it means we don't have to split the monorepo.  At
the very least, it's one chdir less.  Now, building from the zuo
subtree is not a requirement, but imho it would make a better case for
versioning.

> 
> > > +         (file-name (git-file-name "racket" "8.6"))))
> > > +      (outputs '("out" "debug"))
> > > +      (build-system gnu-build-system)
> > > +      (inputs (list bash-minimal))
> > > +      (native-inputs (list bash-minimal))
> > > +      (arguments
> > > +       (list
> > > +        #:configure-flags
> > > +        #~`(,(string-append "CPPFLAGS=-DGUIX_RKTIO_BIN_SH="
> > > +                            #$(file-append (this-package-input
> > > "bash-minimal")
> > > +                                           "/bin/sh"))
> > As with chez-scheme, I do think using a Racket-agnostic macro name
> > is helpful here.
> 
> I'm planning to respond in the other thread about the possibility of
> a truly generic macro name, but I hope it doesn't need to become an
> issue blocking this patch series. For now, I'm not entirely sure what
> "Racket-agnostic" means; the bottom line for my is I think it would
> be absurdly awful to have to write, e.g. if cross-compiling using
> `distro-build` with the top-level Makefile:
> 
>     ./configure CPPFLAGS="GUIX_RKTIO_BIN_SH=/input/bin/sh
> GUIX_ZUO_BIN_SH=/input/bin/sh GUIX_CHEZ_BIN_SH=/input/bin/sh"
> CPPFLAGS_FOR_BUILD="GUIX_RKTIO_BIN_SH=/native-input/bin/sh
> GUIX_ZUO_BIN_SH=/native-input/bin/sh GUIX_CHEZ_BIN_SH=/native-
> input/bin/sh"
GUIX_CHEZ_BIN_SH would semantically cover all four however, no? 
(Ignoring more generic options for now.)

> > > +      (home-page "https://github.com/racket/zuo")
> > > +      ;; ^ This is downstream of
> > > https://github.com/racket/racket,
> > > +      ;; but it's designed to be a friendly landing place
> > > +      (synopsis "Tiny Racket for build scripts")
> > > +      (description "You should use Racket to write scripts.
> > Sorry, but I prefer Guile.
> 
> (At the risk of responding seriously to what was probably meant to be
> a joke:) I've never tried to use Guile on Windows, but, given that
> the manual chapter is called "POSIX System Calls and Networking",
> it's not clear to me that Guile provides as portable and powerful
> "primitives for dealing with files and running processes" as Zuo, let
> alone Racket.
At the risk of responding seriously to what was probably meant to be a
joke, I don't use Winblows 😉️

> > 
> > >   But what if you
> > > +need something much smaller than Racket for some reason—or what
> > > if
> > > you're
> > > +trying to script a build of Racket itself?  Zuo is a tiny Racket
> > > with
> > > +primitives for dealing with files and running processes, and it
> > > comes with a
> > > +@command{make}-like embedded DSL.
> > > +
> > > +Zuo (作) is a Racket variant in the sense that program files
> > > start
> > > with
> > > +@code{#lang}, and the module path after @code{#lang} determines
> > > the
> > > parsing
> > > +and expansion of the file content.  That's how the
> > > @command{make}-
> > > like DSL is
> > > +defined, and even the base Zuo language is defined by layers of
> > > @code{#lang}s.
> > > +One of the early layers implements macros.")
> > > +      (license (list license:asl2.0 license:expat)))))
> > Rarely have I read a description this long, yet uninformative.  Let
> > me
> > shorten that a little: "Zuo is a tiny Racket variant that can be
> > used
> > to bootstrap Racket.  It comes with primitives for dealing with
> > files
> > and processes, as well as a @command{make}-like DSL."
> > 
> 
> This is the description from the Zuo documentation and readme file. I
> find your shortened version less clear than the original. The details
> about `#lang` as a Racketeer are important to understand in what
> sense Zuo is a "Racket variant", given that it is not currently
> possible to run `#lang zuo` programs using the `racket` executable.
Would it make sense to call zuo a "dialect" then?

> (IIUC someone is working on a Racket package implementing `#lang
> zuo/kernel`, at which point that will change.) I also think "can be
> used to bootstrap Racket" greatly underplays the potential of Zuo. A
> number people have already taken an interest in or started
> experimenting with Zuo outside of building Racket.
I have not claimed that it's use is limited to bootstrapping Racket. 
Rather, I think this bootstrapping capability shows that Zuo can be
used to do real programming™.

Cheers