From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA12609 for caml-redistribution; Fri, 26 Jun 1998 01:24:57 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA25506 for ; Tue, 23 Jun 1998 19:00:32 +0200 (MET DST) Received: from heplix.ikp.physik.tu-darmstadt.de (heplix.ikp.physik.tu-darmstadt.de [130.83.24.24]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA28098; Tue, 23 Jun 1998 19:00:30 +0200 (MET DST) Received: (from ohl@localhost) by heplix.ikp.physik.tu-darmstadt.de (8.8.5/8.8.5) id TAA14797; Tue, 23 Jun 1998 19:00:26 +0200 Date: Tue, 23 Jun 1998 19:00:26 +0200 Message-Id: <199806231700.TAA14797@heplix.ikp.physik.tu-darmstadt.de> From: Thorsten Ohl To: Xavier Leroy Cc: William Chesters , caml-list@inria.fr Subject: Re: Functors ... In-Reply-To: <19980623120340.24172@pauillac.inria.fr> References: <23811.199806151807@venus> <19980623120340.24172@pauillac.inria.fr> X-Mailer: VM 6.36 under Emacs 19.34.1 Reply-To: ohl@hep.tu-darmstadt.de Sender: weis Xavier Leroy 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]