From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timothy Sample Subject: Building Bash with Geesh Date: Fri, 07 Dec 2018 10:44:17 -0500 Message-ID: <87pnudwdda.fsf@ngyro.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVIIi-000218-Sb for guix-devel@gnu.org; Fri, 07 Dec 2018 10:44:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVIIf-0007WV-MS for guix-devel@gnu.org; Fri, 07 Dec 2018 10:44:24 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Hi Guix, Over the last year, I built Geesh , which is a simple Shell interpreter written in Guile Scheme. As of the other day, it is capable enough to build Bash! (That=E2=80=99s 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=E2=80=99t even prompt for input!) However, thanks to the robustness of Autotools, Geesh is capable of being the shell used to run Bash=E2=80=99s =E2=80=9Cconfigure=E2=80=9D scri= pt and do everything required (of a shell) to build Bash. (As an aside, =E2=80=9Cconfigure=E2= =80=9D scripts are amazing! Geesh does not support =E2=80=9C$LINENO=E2=80=9D, but the scr= ipt works around this by running itself through =E2=80=9Csed=E2=80=9D and replacing e= very =E2=80=9C$LINENO=E2=80=9D with the current line number. It then restarts i= tself as this new script that doesn=E2=80=99t use =E2=80=9C$LINENO=E2=80=9D.) Actually, = I=E2=80=99m only 99% sure of this, because I have not worked on actual bootstrapping yet (see the caveats below). Checkout =E2=80=9Ctests/bash-without-bash.scm=E2=80=9D for= how I=E2=80=99m currently testing this claim. Now, there are some caveats with respect to actual bootstrapping: =E2=80=A2 It does not have a non-Autotools build script; =E2=80=A2 It requires Guile 2.2, while (I assume) the current bootstrap Guile is version 2.0; =E2=80=A2 It still requires Core Utilities, though many of the utilitie= s 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 =E2=80=9Ccoreutils&co=E2=80=9D bootstrap binary. We certainly could ma= ke 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, =E2=80=9Cwhat about Gash?=E2=80=9D (For= those who don=E2=80=99t know, Gash is also a Shell interpreter written in Guile .) The Gash folks and I have been thinking for a while about the best way to share work and combine efforts. Finally, and I=E2=80=99m just putting this out there ;), if you=E2=80=99re = 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