Re: Avoiding compilation cascades

From: Jan Vorbrüggen (jvorbrueggen-not_at_mediasec.de)
Date: 09/27/04


Date: Mon, 27 Sep 2004 09:00:55 +0200


> I have seen evidence that other groups avoid compilation
> cascades by creating the equivalent of C header files. These
> header files contain only module interfaces and are included
> by their respective modules. The inter-module dependencies
> are then tied to these interface files and not the full module.
> Thus, when a given module is changed but it's interface remains
> unchanged, only the altered module needs to be recompiled and
> not ever module that may use it.

The problem with this approach is of course that the compiler has no
way to check that the seperate interface definition and the actual
interface are consistent. In C et al., this achieved by including the
interface definition (the .h file) into the source as well - I'm not
sure, but I think you cannot do that in Fortran. Thus, if you do not
have a development process that makes sure that any changes in interface
are also immediately reflected in the include file, you open yourself to
the age-old problems of inconsistent interfaces.

Are compilation cascades really that big a problem? A lot of compilers
achieve a substantial part of their optimization by doing whole-program
analysis and interprocedural optimization...which means you are re-
compiling "everything" (for a suitable definition of everything with
regard to libraries et al.) in any case, so why not do it sa{f|g}ely?

        Jan



Relevant Pages

  • Re: how to find the type of an object represented by an interface
    ... Simplifying, generics are strictly linked to compilation, not runtime. ... Dim result as Integer = FooClass.Foo ... template parameter T must implement particular interface i.e. IDisposable: ... Readonly property MaximumRange() as Integer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: New versions of VC++ still stuck with function prototypes?
    ... could drastically improve compilation speed. ... better separation than the other languages. ... interface section and one implementation section. ... precompiled header files to speed up compilation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Javascript taking over?
    ... stronger typed languages finding more problems during compilation. ... If you combine static and dynamic typing the exits from static ... made explicit with so called interface functions. ... Seed7 - The extensible programming language: ...
    (comp.lang.misc)
  • Re: New versions of VC++ still stuck with function prototypes?
    ... > that could drastically improve compilation speed. ... you've got nothing to separate a class interface from implementation. ... Concerning templates, ... > precompiled header files to speed up compilation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: compilation for portability
    ... afaik, both the newer JREs and .NET tend to do this. ... portability to maintain their monopoly. ... compilation (such as direct access to the underlying OS, ... Native Interface). ...
    (comp.programming)