[gambit-list] Using the JavaScript back-end

Marc Feeley feeley at iro.umontreal.ca
Tue Feb 3 12:00:20 EST 2015


To understand why “make from-scratch” is necessary, you have to know that Gambit is self-hosted.  The Gambit system is mostly written in Scheme, and those Scheme files are compiled by the Scheme compiler into .c files.

So for example gsc/_t-univ.scm (the file implementing the universal backend that I changed a few days ago) is compiled to gsc/_t-univ.c .  However, the github repository does not contain the most up to date gsc/_t-univ.c file whereas gsc/_t-univ.scm is up to date.  Keeping these files in sync in the repo would cause the git repo to take a lot of space.  That’s because the smallest change to a Scheme file will result in most of the corresponding .c file to change (different label names, temporary variable names, register allocation, etc), and the .c files are huge (gsc/_t-univ.c is currently 130 KLOC).

Instead of keeping the .scm and .c files in sync in the repo, the .c files of the most recent release of Gambit are kept in the repo.  That way, when you do a “make” after cloning the github repo you get the version of the Gambit compiler that existed at the most recent release.  Then that compiler can be used on the .scm files to produce up to date .c files.  That is what “make from-scratch” does (it builds the .c files “from scratch” from the current .scm files).  The makefile rule is:

from-scratch: fake_target
    $(MAKE) bootstrap # make gsc compiler of latest *release*
    $(MAKE) bootclean
    $(MAKE) bootstrap # make gsc compiler corresponding to repo HEAD
    $(MAKE) bootclean
    $(MAKE) all       # make everything with repo HEAD gsc compiler

Marc

> On Feb 3, 2015, at 11:25 AM, Blake McBride <blake at mcbride.name> wrote:
> 
> Son-of-a-gun, that did fix it.  Apparently, my imagination is a little short.
> 
> Thanks!
> 
> Blake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4839 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150203/b0b3c2ce/attachment.bin>


More information about the Gambit-list mailing list