Date: Tue, 23 Jun 1998 19:00:26 +0200
From: Thorsten Ohl <firstname.lastname@example.org>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Subject: Re: Functors ...
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
-- Thorsten Ohl, Physics Department, TU Darmstadt -- email@example.com 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