Print

Print


On 10/25/05, Sean Luke <[log in to unmask]> wrote:
>
>
> Given all this, here are my general responses:
>
> - Ant. A lot of Java developers rely on ant to do their building,
> particularly ones doing enterprise development. In all honesty, I am
> less than impressed with Ant. It's very slow, its proposed
> replacement for Make's problems is an XML syntax that's even *more*
> error-prone to write, and importantly, its primary touted claim (no
> shell) is also its biggest failure. Ant is okay for compiling Java
> but I'm happy with my makefiles, and I do not think that ECJ's build
> process ("compile everything") is complicated enough to bother doing
> much more than that absolutely trivial makefile we provide. I
> understand the usefulness of Ant to certain developers, but moving to
> it will make *me* less productive, and I think that's probably not a
> good idea. I have no problem if people want to provide ant scripts
> for ECJ, but they'll need to be in a contributions directory, and I
> can't be held to update the scripts with new versions of the
> software. Someone else will have to keep them up to date.
>

Even if ANT is slow, which many people believe it isn't thats still not
a real argument not to use it. ANT is so much more powerful than make,
it just makes sense to use it for every project bigger than 20 source files.
Many people use ANT to make scripts which get the source from CVS,
compile it, test it, package it and the distribute it, by moving it to a web
server or somewhere else. All that in a simple ANT script.
I don't believe you should ANT in your direct development cycle, thats
where and IDE is for. I only use it for the distribution and compatibility
with other people working on the project.
I don't have make on my Windows machines, but I have ANT installed
everywhere.

- Changing the brace style. <rant> Java has a standard brace style
> that was largely imposed by Sun. Some people actually think it's a
> good style, though it's more or less a warmed-over version of the
> much-maligned 1TBS brace style (see wikipedia). It's too easy to
> lose the first brace. I suspect this style will go away as Sun's
> control loosens: the C/C++ community has already standardized on a
> better style all-around IMHO (BSD/Allman). </rant> As long as I'm
> the lead developer in ECJ, I'd really prefer it stay whitesmiths: I
> am comfortable in it and it works with my muscle memory. Besides,
> ECJ's makefile can trivially reformat between bsd and whitesmiths.


The first thing I did when I downloaded ECJ and changed the folder
structure to match my other projects and loaded in to Eclipse, was to
select all files and do auto format. Basicaly, the default Eclipse
formatting works great for me, besides a small tweak regarding switch
cases. It's not really important, but the default Eclipse format is almost
universaly adopted, not because of Eclipse, but because it's almost a
standard.

- Java 1.5. Since its inception I've tried hard to make ECJ
> compatible with as broad an audience as possible. That includes
> avoiding lock-in to the latest and greatest Java versions,
> particularly when there are few good reasons to do so. Java 1.5's
> generics are a great example: they are little more than syntactic
> sugar, which is frustrating because there was a good system already
> available which provided generics that truly handled basic data types
> without needing to box and unbox (which is unbelievably expensive).
> Sun decided to go with the cheapo route and as a result their
> approach is only useful for making code more readable. But, for
> example, ECJ's VectorIndividual subclasses will still have to be
> IntegerVectorIndividual, FloatVectorIndividual, etc., because the
> boxing and unboxing is so slow that converting them over wouldn't be
> very useful. Another problem is that our primary development
> environment is Macs, and Apple always is a year behind Java-wise.
> I've taken pains to avoid adding features that force people to
> upgrade their Java system; at present ECJ requires Java 1.2 at most,
> though the GUI I think may require Java 1.3. I think upgrading to
> 1.5, at this time, is not wise.


The Java 1.5 stuff is not just syntactic sugar for the programmers. It also
contains extra error checking. I agree with the use of arrays and dedicated
data structures for primitives, but I do not agree with the whole
abolishment
of all Java 1.5 generics. I can hardly live without generics anymore. All my
data structures are generic and it helps me code and code with less errors.
Also, using Java 1.5 doesn't make it impossible to run the bytecode on java
1.3 jvm's if it is bundled with the backwards compatiblity classes, like
Enum
and StringBuilder. The JVM is also faster, but 1.6 will be even faster.


> - Directory structure. ECJ's directory structure is unusual: at the
> very least we may move the ec directory into a top-level 'ecj'
> directory, which could also contain the 'docs' directory, etc. I
> don't know how I feel about separating the source from classfiles.
> The primary advantage of moving the classfiles elsewhere, that I can
> see, is to be able to jar up the files easily. But that's not very
> helpful to us: ECJ's intended to be a hackable, modifiable source
> directory, not a static one. ECJ is not JEdit or Xith3D.


Its much easier for me to have seperate class and source folders.
When you want to manualy clean the build you just delete the bin folder.
When you want to zip the files and mail them to someone, just zip the
source.
The ant script is also a little easier to write.

- Efficiency. Always wary of Knuth's omen, I must mention that ECJ
> is fast *because* of its attention to efficiency. This is important
> for us: as mentioned earlier, my student's experiments often involve
> many billions of GP node evaluations. And that's not uncommon: many
> people use ECJ for very large experiments where speed matters. That
> being said, there are TONS of examples in ECJ where I overoptimized,
> often because Java VMs in the past were terrible at optimizing
> themselves, and now I've been taking pains to remove them as the VMs
> have improved. ('final'; hard-code inlined functions where HotSpot
> is known inline now; etc.). The big remaining places where we had to
> make trade-offs in the name of optimization is ECJ's wide use of
> arrays rather than ArrayLists or Vectors. As mentioned in an earlier
> message, the difference in speed between arrays and ArrayLists is
> amazing. ECJ's almost total lack of synchronization is another place
> where it's benefitted speedwise. I've tried hard to balance this
> with flexibility in the structure, but I would welcome suggestions
> and examples where ECJ's overly-complex, particularly in the name of
> unnecessary optimization.


Besides changing the directory structure and formatting the code so that
it is readable to me I didn't change anything to the base code. Besides
removing one final keyword from a method I needed to override to implement
my own dynamic type checking for my GP project.
JVM's are much more efficient with handling unneeded synchronized keywords
and unmarked final methods and classes. Java 1.5 also supports new types
of more efficient multithreading primitives, like AtomicInteger and
AtomicReference, for if anyone ever wants to redesign ECJ with more
communication between the seperate threads.

It *is* true that ECJ is over-engineered. I've been tweaking ECJ to
> make it easier to use. I could use help there both in suggestions
> and in code help: see for example my previous email about getting rid
> of protoCloneSimple. Adding a new loading facility to the
> ParameterDatabase would be helpful as well.
>
> Sean
>