[gambit-list] Vyzo, how do we use Gerbil for incremental dev, it's unclear, please clarify how use |import| for auto-recompile&auto-reimport

Adam adam.mlmb at gmail.com
Thu Oct 3 10:59:14 EDT 2019

Hi Vyzo,

So finally read https://github.com/vyzo/gerbil/blob/master/README.md and
all subpages on https://cons.io/ word by word.

I was trying to go through the obvious moves of incremental dev and it
crashed down totally. Kindly point out the misunderstandings and any Gerbil
customizations that are needed for this obvious usecase:

   1. I create a module "a.ss" (this is a typo, should be "a.scm" but i
   understand Gerbil has an exotic default, query about how to normalize the
   setting in subsequent email). Code is:

   (display "Hello world\n")

   2. Compile the module:

   The documentation does not disclose how to do this from the REPL, so I
   do it by

   GAMBCOMP_VERBOSE=yes gsx a.ss

   I see that this works as ~/.gerbil/lib/ now gets a module file (.o*),
   great. Now,

   3. Import the module:

   (import "a")

   So far, the correct thing happens: The text "Hello world" is printed out.

   4. Now, with gsi running, separately in another xterm we alter a.ss
   (a.scm) a bit, we add two exclamation marks to the string, so the content
   is now:

   (display "Hello world!!\n")

   5. In the gsi REPL, we run again:

   (import "a")

What happens now is a mysterious nothing!

This shows that Gerbil does not automatically reimport updated dependencies.

Also, no new binary is produced - there is no output showing any gcc
invocation (which is the behaviour specified by "GAMBCOMP_VERBOSE=yes"),
and also "ls -l ~/.gerbil/lib/" shows that no new .o* files have been


There is no mentioning in the documentation of how to make |import|
automatically recompile any module that has been compiled already AND
automatically reimport any module in the dependency graph, whose
modification timestamps have changed since the previous |import|.

The obvious usecase at hand is that you have more files as dependencies in
a code project, and as you go about development you edit them sporadically,
and Gerbil will have them auto-recompiled, auto-reimported and their global
namespace auto-evaluated (in a.ss's case, a |display|) as you go along,
this is essential.

Is this about a Gerbil setting that I need to configure, or a question of
deep Gerbil hacking, or is Gerbil unfit for the work and I should leave it



Following rectification of the above, I would throw in some FFI stuff like

echo "((c-lambda () void "printf(\"Hi from C\\n\");\"))" >> a.ss

to see that FFI stuff is handled symmetrically in the same fashion as any
other Scheme code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20191003/3f9f4fcd/attachment.htm>

More information about the Gambit-list mailing list