gcj -D
Mike Moreton
mike@pillim.demon.co.uk
Mon Oct 18 07:57:00 GMT 1999
Tom,
Your use of the '-D' parmameter to gcj got me thinking - I'm a newcomer to
Java, so go gentle on me if some of this betrays a lack of knowlege.
I come from a real-time software background, where performance is often
critical. While Java may increase programmer productivity, it's really
a non-starter in this sort of environment because the interpreter is just
too slow. So a fully compiled Java is obviously of interest - it solves
one of the big problems (the other is the garbage collector).
Now when you're writing such performance critical embedded code, another
problem is tracking down bugs. You can't add defensive or tracing
code, because it affects the performance. But you need LOTS of that code
for debugging.
The normal technique used in C, is to use the CPP to cut out all the debugging
code in the runtime system, but leave it in for the debug version. This has
to be a compile time decision, because deciding at run-time wastes perfromance
in itself.
I believe that if Java is to become a general purpose programming language,
it's going to need a pre-processor, and I'd prefer it to be a standard
one, rather than each project inventing their own.
If this is the case, the -D option is going to be needed for defining
pre-processor symbols (as it is with C and C++). It sounds like using it for
something that is essentially different, is one of those things that will
come back to haunt you in later years.
Mike.
More information about the Java
mailing list