[antlr-interest] GCJ

Robert Colquhoun rjc at trump.net.au
Mon Jul 14 17:36:23 PDT 2003


At 02:01 AM 15/07/2003, Pete Forman wrote:
>At 2003-07-14 23:06 +1000, Robert Colquhoun wrote:
> >At 11:28 AM 14/07/2003 +0200, Ric Klaren wrote:
> > >On Mon, Jul 14, 2003 at 12:19:32PM +1000, Robert Colquhoun wrote:
> > > > Also java source files are kind of different from C/C++ there are no
> > > > includes(making for a much faster compile) and dependencies can be very
>
>Includes are done with the import statement.

But that is not like a C/C++ #include which pulls in another file which the 
compiler has to parse.  Java 'package' and 'import' is a bit like C++ 
'namespace' and the 'using' directive.

In bigger C/C++ it is not unusual for the compiler to have to pull in > 
10,000 lines of includes every time it parses a single source file.  This 
takes time slowing the build perhaps more time than compiling the actual 
source files themselves.  Some compilers do precompiled headers to try and 
mitigate this.

> >As soon as you make a java change you need to recalculate the dependency
> >tree using some tool.  That's not happening with the configure/make stuff
> >at the moment there is only the original dependencies.
>
>The Java compiler handles dependencies internally.  If you compile
>just one file then all the .java files it references are compiled as
>well (including indirect references) if they have no .class.  It is
>often enough just to name those files with a main() on javac's command
>line.

Can get in trouble though if you compile one file that has a dependency 
which already has a class file available....it doesnt check to see if the 
dependency source is out of date with respect to its class file unless the 
dependency itself is also specified on the command line.

>The traditional way of compiling C/C++ one file at a time under make
>or similar is not well suited to Java.  It is best if javac can be
>invoked once only during a build.

Yes for sure - the javac compiler has to start up a jvm which is expensive, 
some relief can be gained by using a compiler like jikes if you like makefiles.

  - Robert


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list