Re: Functors ...

From: Thorsten Ohl (ohl@hep.tu-darmstadt.de)
Date: Tue Jun 23 1998 - 19:00:26 MET DST


Date: Tue, 23 Jun 1998 19:00:26 +0200
Message-Id: <199806231700.TAA14797@heplix.ikp.physik.tu-darmstadt.de>
From: Thorsten Ohl <ohl@hep.tu-darmstadt.de>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Subject: Re: Functors ...
In-Reply-To: <19980623120340.24172@pauillac.inria.fr>
        <19980623120340.24172@pauillac.inria.fr>

Xavier Leroy <Xavier.Leroy@inria.fr> writes:

> In principle, the module language is terminating, so the compiler
> could simply generate a copy of the functor body at each functor
> application point, and work from here. This would allow more
> direct calls and inline expansion -- as much as if you'd written
> your code without functors -- but results in loss of separate
> compilation (the functor body is recompiled over and over again)
> and code bloat. C++ templates have precisely those two problems.

What about a compiler option (or directive) for selective functor
expansion? This way one can use the profiler (or static information
about the program) to fight code bloat by expanding just the functor
applications in the compilation units that appear to produce the most
frequently executed code?

I agree that it is not a very elegant solution. But why not, as long
as it helps to fight the misconception that functional programming is
slow?

Cheers,
-Thorsten

-- 
Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
http://crunch.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:14 MET