Re: does nice have separate compilation, or does it effectively "compile" a whole program at a time?

Daniel Bonniot <[email protected]> Thu, 16 Jun 2005 16:34:45 +0200
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
> Does nice have separate compilation, or does it effectively  "compile"
> a whole program at a time? 

It has separate compilation!

> package test.intersect;
> import test.rectangle;

...

> 1) I:\Nice\Test>nicec --sourcepath .. --classpath .. -a test.jar test
> compiles OK
> 
> 2) hide shape.nice, circle.nice, intersect.nice, hoop.nice
> 
> 3) retract intersect implementation in rectangle.nice 
> //intersect(Rectangle s1, Rectangle s2){}

The interesect package imports rectangle, and you modified the rectangle 
package. Therefore, intersect also need to be rechecked. Separate compilation 
guarantees you the opposite: if intersect changes, rectangle does not have to 
be recompiled.

I know that javac is more lazy about recompilation, but that also means it 
lets errors slip in. See all the subclasses of java.lang.LinkageError (for 
instance NoSUchMethodError) that can be thrown at runtime because of this 
incomplete checking at compile time.

It is a fundamental part of Nice's philosophy to spend a bit more time 
performing checks at compile time to make sure that the program will not crash 
at runtime. We should of course also try to keep compilation fast enough, but 
not at the cost of unsafety.

Cheers,

Daniel

PS: could you forward my answer (not necessarily literally) to the newsgroup?


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click