guix-devel
[Top][All Lists]
Advanced

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

Re: How did you handle making a GNU/Linux distribution?


From: Philip McGrath
Subject: Re: How did you handle making a GNU/Linux distribution?
Date: Sun, 22 Aug 2021 18:54:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hi Sage,

On 8/22/21 5:53 PM, Sage Gerard wrote:
Thanks for the detailed answer!

It seems wise to adapt GNU Mes towards Racket or Chez Scheme instead of
Guile to bring GNU's benefits to more Scheme and Racket programmers. Has
someone already tried something like that?

I haven't tried Xiden yet, and I haven't done any concrete work toward this (I have been working on managing Racket packages with Guix), but Christine Lemmer-Webber had floated the idea at some point of trying to integrate Racket and Guile.

IIRC, I think what she's had in mind was trying to make a Guile backend for Racket along the lines of the Chez Scheme backend (or the BC backend, or experimental backends like Pycket).

As I said, I haven't actually tried any of this, but, as I've thought about what might be involved, there are two things that have struck me as downsides:

 1. Flatt et al. say in "Rebuilding Racket on Chez Scheme (Experience
    Report)" (§6, p. 13) that, "If our task were to compile Racket to an
    existing target, then we would not have achieved such a high degree
    of compatibility. … we have taken the liberty of modifying Chez
    Scheme to make it an easier target for Racket."

    https://www.cs.utah.edu/plt/publications/icfp19-fddkmstz.pdf

    Presumably a Racket-on-Guile project would face the same trade-off,
    where modifications to Guild, if Racket CS is a guide, could require
    hard work over many years, and lesser compatibility would make the
    result less useful.

 2. As you probably know, Racket programs can't generally use
    Chez Scheme implemented libraries, because Chez Scheme effectively
    is the "unsafe" layer of the Racket VM. For example, not all Racket
    procedures are Chez Scheme procedures, and Racket's continuations
    wrap Chez Scheme's to implement delimited and composable control,
    threads, parameters, full continuation marks, etc.

    For Racket CS, this isn't a great loss (there aren't so many
    Chez-specific libraries, and portable libraries can run in Racket's
    R6RS language), but, for a hypothetical Racket-on-Guile,
    bidirectional interoperability would be a big attraction: imagine
    Guix, Shepherd, Mcron, syntax/parse, racket/contract, and more all
    working together.

If I were going to work on this, I'd start by looking at having Racket and Guile coexist as siblings with interoperability through their FFIs level. Even better, eventually you could compile Guile to Racket linklets, so the two could coexist in the same primitive module system. There would probably always need to be something along the lines of require/typed to interoperate between the languages, since Guile has mutable pairs and an unusual approach to falsehood and nullity to let Scheme's #f and '() coexist with Emacs List's nil. (See https://www.gnu.org/software/guile/manual/html_node/Nil.html).

I'm at the point where users are requesting a GNU/Linux distribution for
Xiden, such that Racket is the primary language for day-to-day
operation. I'm ignorant of the scope of work, and am unsure if I can do
it alone.

To me, at least, the scope of the work in creating a new GNU/Linux distribution seems daunting. My hope would be that bringing Racket and Guile closer together would let most if not all of the effort be shared.

Hope some of this is useful, and best of luck!

-Philip




reply via email to

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