For Programmers: Free Programming Magazines  


Home > Archive > Scheme > November 2004 > Re: Separate compilation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Separate compilation
Bradd W. Szonye

2004-11-04, 3:58 pm

Antoun Kanawati wrote:
> You can't get by without a header file, period. Or, to avoid the
> double negative: you absolutely need the source to compile, and it
> doesn't matter if that source lives in another "module". Everything
> in the header file needs to be compiled, and possibly "executed"; but,
> some things, like templates, take more compiler effort than others
> (plain old primitive C++ declarations).


That was exactly my point. C++ templates take a /lot/ more compiler
effort than simple declarations do. They pose roughly the same problem
as Scheme macros. While the latter have some additional complications,
the compiler effort is the main obstacle to separate compilation.

> The header file language has no restrictions, and it is only by
> convention that it is usually restricted to declarative constructs.
>
> In the C/C++ world that seems to be an acceptable limitation of
> separate compilation ....


It doesn't work for templates, though, just as it doesn't work for
Scheme macros.

> Of course, trying to define a strictly declarative subset of Scheme
> is somewhat more difficult ....


That's a vast understatement! It's the key issue both for Scheme macros
and C++ templates.
--
Bradd W. Szonye
http://www.szonye.com/bradd
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com