Escape Analysis on reddit
bearophile
bearophileHUGS at lycos.com
Sat Nov 1 09:56:45 PDT 2008
Andrei Alexandrescu:
> Excellent point. The compiler can do that, but it would take a long time
> and would need access to the entire source code (the dreaded
> "interprocedural analysis"). This makes modular development difficult.
>
> A solution is to have the programmer put information about the function
> in the function signature. There's a tradeoff to be made so as not to
> burden the programmer with writing too long signatures.
I can see a better intermediate solution: let the compiler do interprocedural analysis on the visible/available modules, and let the programmer add manually the required information at the points where the known and unknown modules interface to each other. This minimizes the work of the programmer while giving the compiler all the information it needs.
Bye,
bearophile
More information about the Digitalmars-d
mailing list