Virtual methods

bearophile bearophileHUGS at lycos.com
Thu Feb 4 02:03:48 PST 2010


Walter Bright:
> Not impossible, and a "pseudo-link" could be done after the semantic 
> phase of compilation, but these things would be a lot of work to implement.

OK. People can live with a compiler that doesn't perform all possible optimizations from its first version 1.0, but I think it's important that the language is not designed to make such improvements / optimizations impossible (or too much hard) to implement (this is also why time ago I suggested D type system to tell apart pinned GC pointers from normal raw unpinned pointers. So if in future D has success someone is free to realize a mostly moving GC, even if now no one is able or interested in doing it. You told me that idea makes the language too much hairy).

Partially unrelated note: LLVM plans to add a profile guided optimization level too, to be used with -O6, as GCC too does. LLVM also plans to do something that GCC is not currently able to do, the level -O7 lifelong optimization. This is like in Java, the profile guided optimization happens at normal runtime too, so you need to keep the llvm compiler along with your shipped binary. D2 language in future can use that technology too. With care and work, this will allow de-virtualize functions at runtime in D2/D3.
http://llvm.org/releases/1.4/docs/CommandGuide/html/llvmc.html

Bye,
bearophile



More information about the Digitalmars-d mailing list