chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] separate compilation


From: F. Wittenberger
Subject: Re: [Chicken-users] separate compilation
Date: Mon, 24 Nov 2008 14:53:24 +0100

Am Montag, den 24.11.2008, 12:46 +0100 schrieb felix winkelmann:
> On Sun, Nov 23, 2008 at 2:45 AM, Jörg F. Wittenberger
> <address@hidden> wrote:
> >
> > It would be easy enough to compile the export file into memory or a temp
> > file and overwrite the old file only if there are differences.
> >
> > This would give us both: one file, which only changes, when the actual
> > interface chances (the .import.scm or whatever name and type is might
> > have one day), and one file, which chances with the implementation (the
> > original .scm).  Now, within the Makefile we could make modules, which
> > depend on the interface depend on the .import.scm and the .o etc. depend
> > on the .c/.scm.
> >
> 
> The fact that the import libs are Scheme source code is just coincidental.

I do!

But it doesn't change a bit.

> Just treat them as additional compiler output, and define dependencies
> purely on the original source files. For separately compiling files that
> introduce compile-time-code, we have to split the run-time- and compile-
> time parts of a source file and allow the separate handling (translation,
> compilation and linking/loading) of these two ports. Theoretically, we
> could compile the import lib on the fly (at the same point where we
> compile the source file), but that would increase the complexity of
> the compiler drivers even more (but I will try to find some time to
> think about this).

Splitting syntax definitions, especially hygienic syntax definitions,
which could reference certain run time values, from pure run time code
is tedious at least with existing source and might hard for writing new
code too[*] (though I understand that portable Scheme is for purists
only, who just want to show off how much features they could spare ;-) .

What is so hard/bad about my idea?  It could even be implemented at the
Makefile level (untested):

.c.scm:
        cp $<.import.scm $<.import.scm.backup
        csc ...
        if cmp $<.import.scm $<.import.scm.backup; then mv $<.import.scm.backup
$<.import.scm; else rm $<.import.scm.backup fi

As far as I understand the idea behind make, it's rather normal to have
dependencies from intermediate (compiler output) files to save compiler
runs.

And if one does not want that, just don't use the intermediate files in
your make rules.

But at least for the developer it's great to save half a hour few times
a day.  And it's such a little amount of code in chicken.  Felix, if
this was not just about the code area your are touching these days, I'd
dare to prepare a diff - or will do so if I knew, it's going to go live.

Thanks

/Jörg

[*] Done well, the result might even question the need of
those .import.scm's since they then contain basically a copy of the
syntax code.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]