all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Building Bash with Geesh
@ 2018-12-07 15:44 Timothy Sample
  2018-12-07 17:08 ` Jan Nieuwenhuizen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Timothy Sample @ 2018-12-07 15:44 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

Over the last year, I built Geesh <https://gitlab.com/samplet/geesh>,
which is a simple Shell interpreter written in Guile Scheme.  As of the
other day, it is capable enough to build Bash!

(That’s the main point of this message.  Everything that follows is just
details.)

Geesh is very simple, and is missing a lot of features.  It does not
even support all of POSIX.  If you are looking for a new shell, Geesh is
not for you!  (It doesn’t even prompt for input!)

However, thanks to the robustness of Autotools, Geesh is capable of
being the shell used to run Bash’s “configure” script and do everything
required (of a shell) to build Bash.  (As an aside, “configure” scripts
are amazing!  Geesh does not support “$LINENO”, but the script works
around this by running itself through “sed” and replacing every
“$LINENO” with the current line number.  It then restarts itself as this
new script that doesn’t use “$LINENO”.)  Actually, I’m only 99% sure of
this, because I have not worked on actual bootstrapping yet (see the
caveats below).  Checkout “tests/bash-without-bash.scm” for how I’m
currently testing this claim.

Now, there are some caveats with respect to actual bootstrapping:

    • It does not have a non-Autotools build script;

    • It requires Guile 2.2, while (I assume) the current bootstrap
      Guile is version 2.0;

    • It still requires Core Utilities, though many of the utilities are
      available as Guile code in Gash.

Of these, I think fixing the first two will be trivial, while fixing the
third will require a bit of work (though hopefully not too much).  Once
these things are done, we will be pretty close to being able to retire
the “coreutils&co” bootstrap binary.  We certainly could make it a lot
smaller.  (AFAIK, we are still missing a few things, but Jan knows
better than I do.)

You may be thinking at this point, “what about Gash?”  (For those who
don’t know, Gash is also a Shell interpreter written in Guile
<https://gitlab.com/janneke/gash>.)  The Gash folks and I have been
thinking for a while about the best way to share work and combine
efforts.

Finally, and I’m just putting this out there ;), if you’re new to Guile
and want a simple project learn with, Geesh might be right for you!  It
was a Guile-learning project for me, and it served its purpose
admirably.


-- Tim

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-12-09 15:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 15:44 Building Bash with Geesh Timothy Sample
2018-12-07 17:08 ` Jan Nieuwenhuizen
2018-12-07 22:21   ` Ludovic Courtès
2018-12-08  0:33     ` Timothy Sample
2018-12-08  6:47     ` Jan Nieuwenhuizen
2018-12-08  1:01   ` Timothy Sample
2018-12-09  4:17 ` Chris Marusich
2018-12-09  6:58 ` Jan Nieuwenhuizen
2018-12-09 15:20   ` Timothy Sample

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.