https://github.com/udem-dlteam/ribbit/commit/14077d111425c8472dd5a0e865462dea70a8d206 Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} udem-dlteam / ribbit Public * Notifications * Fork 17 * Star 277 * Code * Issues 2 * Pull requests 2 * Actions * Projects 1 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights Permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Browse files Add POSIX shell target that allows bootstrapping Ribbit using only a ... ...POSIX shell (be ready to wait 5 hours for the bootstrap using ksh and substantially more for other shells) * Loading branch information @feeley feeley committed Apr 20, 2022 1 parent 831c141 commit 14077d111425c8472dd5a0e865462dea70a8d206 Split Unified Showing 5 changed files with 550 additions and 1 deletion. 1. +12 -1 README.md 2. +15 -0 src/host/sh/makefile 3. +3 -0 src/host/sh/minify 4. +518 -0 src/host/sh/rvm.sh 5. +2 -0 src/host/sh/tests/00-empty.scm There are no files selected for viewing 13 README.md [*] Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters @@ -14,7 +14,7 @@ The Ribbit AOT compiler is written in Scheme and can be executed with Gambit, Gu The AOT compiler's source code is in a single file: `src/rsc.scm` . This Scheme file can be executed as a program with the Gambit, Guile or Chicken interpreters. Alternatively the AOT compiler can be executed using the `src/rsc` shell script, which has the additional `-c` option to select a specific build of the Ribbit AOT compiler which is useful for bootstrapping Ribbit. Ribbit currently supports the target languages C, JavaScript, Python and Scheme which are selectable with the compiler's `-t` option with `c`, `js`, `py`, and `scm` respectively. The compacted RVM code can be obtained with the target `rvm` which is the default. Ribbit currently supports the target languages C, JavaScript, Python, Scheme, and POSIX shell which are selectable with the compiler's `-t` option with `c`, `js`, `py`, `scm` and `sh` respectively. The compacted RVM code can be obtained with the target `rvm` which is the default. The `-m` option causes a minification of the generated program. This requires a recent version of Gambit. @@ -84,3 +84,14 @@ Here are a few examples (all assume that a `cd src` has been done first): $ ./rsc -t py -l max -c "node rsc.scm.js" h.scm # use bootstrapped compiler $ python3 h.scm.py hello! Bootstrap the Ribbit AOT compiler using a POSIX shell (note that with ksh this takes over 5 hours on a fast computer and it can take substantially more with other POSIX shells): $ ./rsc -t sh -l max -o rsc-bootstrap1.sh rsc.scm $ ./rsc -t sh -l max -c "ksh rsc-bootstrap1.sh" -o rsc-bootstrap2.sh rsc.scm $ echo '(display "hello!\n")' > h.scm $ ./rsc -t sh -l max -m -c "ksh rsc-bootstrap2.sh" h.scm $ ksh h.scm.sh hello! 15 src/host/sh/makefile [*] Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters @@ -0,0 +1,15 @@ all: check: @echo "*** TESTING sh TARGET ***"; \ for prog in `ls ../../tests/*.scm tests/*.scm` ; do \ options=`sed -n -e '/;;;options:/p' $$prog | sed -e 's/^;;;options: //'`; \ echo "---------------------- $$prog [options:$$options]"; \ rm -f test.sh*; \ ../../rsc -t sh $$options -o test.sh $$prog; \ sed -n -e '/;;;input:/p' $$prog | sed -e 's/^;;;input://' | sh test.sh > test.sh.out; \ sed -e '1,/;;;expected:/d' -e 's/^;;;//' $$prog | diff - test.sh.out; \ done clean: rm -f test.sh* 3 src/host/sh/minify [*] Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters @@ -0,0 +1,3 @@ #!/bin/sh sed -e '/.*# DEBUG.*/d' Oops, something went wrong. Retry Toggle all file notes Toggle all file annotations 0 comments on commit 14077d1 Please sign in to comment. * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.