[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
Wed Oct 16 16:54:51 EDT 2019


Followup:

I discussed the |import| question below with Vyzo and he says he'll
reimplement a new flavor of |reload| which will have this described
function.

There is a |reload| already (defined in
https://github.com/vyzo/gerbil/blob/master/src/std/interactive.ss ) but
 * it only reimports one given module, not its dependency modules, and in
that gist also
 * does not import added dependencies (it doesn't touch the dependency
graph at all).

So Vyzo needs to make an extended |reload| that does that too.


On Thu, 3 Oct 2019 at 10:59, Adam <adam.mlmb at gmail.com> wrote:

> 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
>
>    ,q
>    GAMBCOMP_VERBOSE=yes gsx a.ss
>    GAMBCOMP_VERBOSE=yes gsi
>
>    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
> produced.
>
> Disaster.
>
> 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
> altogether?
>
> Thanks,
> Adam
>
>
> PS
>
> 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/20191016/f5cf7ff2/attachment.htm>


More information about the Gambit-list mailing list