Import concerns revisited

Dave Dave_member at pathlink.com
Tue Jul 11 15:32:54 PDT 2006


xs0 wrote:
> 
>>> I must strongly reinforce this statement. There is nothing wrong with 
>>> FQNs being automatically available in a program (it's how Java and C# 
>>> work), in fact, I strongly prefer this behavior and am planning to 
>>> implement it in D when we get the FQN import. 
>>> (news://news.digitalmars.com:119/e8r8tt$10cf$3@digitaldaemon.com)
>>
>> The one problem with that may be compilation speed. I suspect that a 
>> big part of  Java's compile-time and load-time problems are because of 
>> all the symbol loading it has to do for a typical class path to enable 
>> things like automatic FQN availability. At the command line, the C# 
>> compiler actually isn't that fast either for small programs, but in 
>> the IDE it seems fast because all this stuff is pre-loaded.
> 
> I don't think it would affect compilation speed at all. Stuff only needs 
> to be looked up when referenced, and if referenced, it needs to be 
> imported anyway.
> 

I don't think that is correct for the reference compiler, because 
Walter's 'static import' proposal still imported the entire module 
(probably because the way the compiler works now is to 'load' an entire 
imported module, IIRC).

> As for slowness of Java compilation, I'd say the biggest speed killer is 
> the fact that the compiler is written in Java itself - Java is the least 
> compiler-friendly language I know.. D is, of course, the best (imho).
> 
> 
> xs0



More information about the Digitalmars-d mailing list