From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timothy Sample Subject: Re: Building Bash with Geesh Date: Sun, 09 Dec 2018 10:20:23 -0500 Message-ID: <878t0ywwug.fsf@ngyro.com> References: <87pnudwdda.fsf@ngyro.com> <87y38zfapu.fsf@gnu.org> 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]:36659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gW0sj-0000yW-9k for guix-devel@gnu.org; Sun, 09 Dec 2018 10:20:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gW0sd-0002dj-Ge for guix-devel@gnu.org; Sun, 09 Dec 2018 10:20:33 -0500 In-Reply-To: <87y38zfapu.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Sun, 09 Dec 2018 07:58:05 +0100") 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: Jan Nieuwenhuizen Cc: guix-devel@gnu.org Hi Jan, Jan Nieuwenhuizen writes: > Timothy Sample writes: > > Hello, > > Attached are two small patches that allow me to run the Gash test suite > with Geesh, like so > > PATH=3D$PATH:bin SHELL=3D'../geesh/pre-inst-env geesh' ./check.sh=20 > > assuming that both projects live in the same parent directory. > > Geesh does much better than Gash, it only fails 11/126 tests. > > Moreover, all POSIX tests pass! The ones that fail involve `echo -e' > and Bash-isms, notably substitutions like ${var/foo} (and all %, %%, #, > ##, ...etc). > > What a great job! Thanks! I had a lot of help from the Oil shell test suite that we talked about before. Right now I am working on sed, but integrating the Oil tests into Gash is something that I want to do soon. With respect to Bash-isms, I=E2=80=99ve been deliberately avoiding them. P= OSIX seemed complicated enough for a first go! The substring operations (=E2=80=9C%%=E2=80=9D, etc.) are all POSIX, but Geesh raises a =E2=80=9Cnot= implemented=E2=80=9D error whenever it sees them. :) > Interestingly, Gash passes all tests that Geesh fails, and Gash fails > about 20 other tests. What an interesting coincidence! > It looks like that once we manage to combine Geesh and Gash, stealing > eachothers code or otherwise, we have a shell that can replace bash and > coreutils&co in the initial bootstrap. I am still of the opinion that Geesh=E2=80=99s parser is its strongest asset (hint, hint). The back-end code is all pretty ad-hoc. > Greetings, > janneke > > Also put up on: https://gitlab.com/janneke/geesh > > From 0aca7e71517b63fc3f67f3a72757f69d7a91158a Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sun, 9 Dec 2018 07:35:18 +0100 > Subject: [PATCH 1/2] guix: Use getcwd instead of hard-coded directory. > > * guix.scm (make-select): Use getcwd instead of hard-coded directory. > --- > guix.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/guix.scm b/guix.scm > index 04973a9..3b647dd 100644 > --- a/guix.scm > +++ b/guix.scm > @@ -24,7 +24,7 @@ > version))) >=20=20 > (define (make-select) > - (let* ((directory (repository-discover "/home/samplet/code/geesh")) > + (let* ((directory (repository-discover (getcwd))) Definitely didn=E2=80=99t mean to commit that! :p > (repository (repository-open directory)) > (oid (reference-target (repository-head repository))) > (commit (commit-lookup repository oid)) > --=20 > 2.19.1 > > From 52d3b6ea3c47a84f58e06e0d09db5ce8f9cf383e Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sun, 9 Dec 2018 07:37:22 +0100 > Subject: [PATCH 2/2] Support -e, -x in geesh script. > > * scripts/geesh.in (options-spec): Support -e, -x. > --- > scripts/geesh.in | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/scripts/geesh.in b/scripts/geesh.in > index fa8001f..e7a0051 100644 > --- a/scripts/geesh.in > +++ b/scripts/geesh.in > @@ -24,17 +24,26 @@ > (set! %load-compiled-path (cons "@GODIR@" %load-compiled-path)) >=20=20 > (use-modules (geesh repl) > + (geesh environment) > (ice-9 getopt-long)) >=20=20 > (define options-spec > '((command (single-char #\c) (value #t)) > - (stdin (single-char #\s)))) > + (errexit (single-char #\e)) > + (stdin (single-char #\s)) > + (xtrace (single-char #\x)))) >=20=20 > (let* ((options (getopt-long (program-arguments) options-spec > #:stop-at-first-non-option #t)) > (command (option-ref options 'command #f)) > + (errexit? (option-ref options 'errexit #f)) > (stdin (option-ref options 'stdin #f)) > + (xtrace? (option-ref options 'xtrace #f)) > (args (option-ref options '() '()))) > + (when errexit? > + (setopt! 'errexit #t)) > + (when xtrace? > + (setopt! 'xtrace #t)) > (cond > ((and command stdin) > (format (current-error-port) -- Tim