Fast Native Eclipse with GTK+ Looks
Mark Wielaard writes "The gcj team created a natively compiled build of the Eclipse IDE. The resulting binary starts up faster then with any traditional JVM since there is no virtual machine to initialize or slow byte code interpreter or just in time compiler involved. This means that gcj got a lot better since the last Slashdot story in December about gcj and Eclipse. Red Hat provides RPMs for easy installation. Footnotes has screenshots by Havoc Pennington of the Eclipse IDE with GTK+ widgets."
From what I heard so far, gcj has problems with garbage collection and doesn't generate very good code. Did I miss any dramatic improvements recently? Also, how complete is the class library?
GCJ aka "native Java" now really seems to be ready for its day under the spotlights.
I leave stuff like mozilla, eclipse, and xemacs running for weeks on end.
I found this info at http://gcc.gnu.org/java/
6 748
"A team of hackers from Red Hat has released RPMS for a version of Eclipse, a free software IDE written in Java, that has been compiled with a modified gcj. You can find more information here. We'll be integrating the required gcj patches into cvs in the near future."
ps
Slashdot preview is buggy today...can't do HTML format preview and links one or more spaces get embedded in URLs (like the one below).
---
My most underrated Slashdot post is http://slashdot.org/comments.pl?sid=68610&cid=627
What is yours?
There is another FOSS IDE called gps. They call the unsupported version the "academic edition", but you can download the source, and a peak at a few files shows that it's GPL'd. (Their economic model is to give it away for free and sell support for those who need it.)
It's a cross-platform IDE, with binaries available for Linux, Solaris, and various versions of Windows, and in principle you should be able to build it on any *n*x system where you can get GTK2 to run.
The bad news is that language support is still limited. It has full support for Ada and partial support for C and C++, which are lower priorities for the authors. It comes with instructions for setting up support for your language, but that looks like a non-trivial task.
I've just started playing with it so I can't give a good review, but so far it has been very helpful. The features listed at their Web site are:
- Language-sensitive editor
- Automatic generation of body files
- Source code reformatting
- Intelligent source code navigation
- Context-sensitive search and replace
- Application builder
- Automatic code fixing
- Version control (CVS, ClearCase, etc.)
- Visual file comparison
- Graphical source-level debugger
- Project and program entities explorer
- Project wizard
- Types and program entities graphs
- Call graphs
- File dependency graphs
- Project dependency graphs
You can use the built-in editor or make it pop up your favorite editor. If you use the gnuclient Emacs interface you get the same kind of language-sensitive pop-up menus you get with the built-in editor.Screenshots are available at the link above.
Sheesh, evil *and* a jerk. -- Jade
The eclipse IDE is supposed to be extremely pluggable. How does natively compiling it affect that? Do you have to compile the plugins with the IDE? Or can you still just drop the .class files somewhere?
if(!cool) exit(-1);
The intriguing idea behind JIT compilers is that the result can be optimized for your exact configuration (AMD vs Intel, particular kinds of RAM, etc.) It can even (conceptually) optimize the same program differently at different times depending on usage. At, of course, a startup penalty and runtime compilation overhead.
I don't know how much of this potential is actually realized in JITs (it's insanely hard to do) and how much of a difference it makes in the end. How substantial would the difference between a specialized AMD vs Intel optimziation be, for example (which would presumably depend on the task)?
I suppose the best possible world would be to have the optimization run exactly once, the first time you install a program. (Yeah, you could conceptually move the same installation to a different CPU, or add more RAM, or some such, but let's not make an already messy issue even messier.)
I doubt such things are easy to benchmark, and the best test may well be something like this (gcj'd Eclipse), where the end result to the user is "which one feels faster?" and "which one actually runs faster?"
And [Java] continues to be hyped, and is being used less and less, as the speed continues to hamper it.
Java is still some 40 times faster than Python. As hardware speed continues to obey Moore's law, performance per clock cycle becomes less important. (For many areas of computing anyway.)
Have you used Metrowerks Codewarrior? Now there's an IDE. It's a joy to use. Runs on Mac and Windows. I think there is a Linux version that uses gcc, but I haven't tried it.
(I admit I haven't tried Eclipse yet, but I would be very surprised if it were better than CodeWarrior.)
Everything Just Works in CodeWarrior. I've even got my wife, a web designer who prefers to hand-code her HTML, to use it to write her web pages.
CodeWarrior supports C, C++, Java and inline assembly. If you prefer makefiles, there are command line tools that provide the same compiler. Old versions of CodeWarrior also supported Pascal, but I don't think they do anymore.
The ISO compliance of CodeWarrior's C++ is far superior to Visual C++'s, and has been quite compliant for a very long time. I've been happily using the Standard Template Library in very complex ways, as well as writing my own fancy templates, for several years.
Alexei Alexandrescu used CodeWarrior to develop the heavily templated source code for Modern C++ Design. Visual C++ can't compile it because of its poor compliance to the standard.
It is also available for many embedded systems. Metrowerks was acquired by Motorola a while back, who makes the ColdFire and PowerPC processors that are important in the embedded world.
Request your free CD of my piano music.
This will be useful for QNX, for which Java support is weak.
I don't know how well it works but I can see the potential.
Request your free CD of my piano music.
Thanks to the expected slashdotting, this is just one more eclipse I can't look directly at.
I was actually talking about VS.NET :-). I agree its a huge improvement over its predecessor, especially when it comes to larger projects. VS was almost unusable on the last VC++ project I worked on if the whole workspace was loaded. Both IntelliJ and Eclipse offer far more in terms of editor power and ease of refactoring code than VS.NET though.
Unfortunately one of the reasons IntelliJ has got more expensive is because of its success. Its about 100$ more expensive now than when I purchased it. If you are doing a lot of Java development and dont have a compelling requirement for a GUI builder then I strongly recommend IntelliJ.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
Top four reasons VC++ is better than any open source IDE:
1) Lead developer has a cool name, like "Anders Heljborg".
2) Lead developer earns a cool salary, like $1,000,000+ a year.
3) Lead developer has legion of microsoft's code monkeys implementing and testing features out the yang, and they still can't burn up all the money they extort from, err, i mean charge, their customers.
4) Anders Heljsborg rewite and maintainence has been going on for four or five years. Give eclipse a chance to ketchup.
> The intriguing idea behind JIT compilers is that the result
> can be optimized for your exact configuration (AMD vs
> Intel, particular kinds of RAM, etc.) It can even
> (conceptually) optimize the same program differently at
> different times depending on usage. At, of course, a
> startup penalty and runtime compilation overhead.
True, the optimization for hardware platforms are less significant than the overall optimizations.
> I don't know how much of this potential is actually
> realized in JITs (it's insanely hard to do) and how much of
> a difference it makes in the end. How substantial would
> the difference between a specialized AMD vs Intel
> optimziation be, for example (which would presumably
> depend on the task)?
Its huge, Java is already faster than C++ is some benchmarks (very slightly) but the problem is that this feature doesn't benchmark well.
Technically optimizing JIT's aren't all that hard to write since this subject is far from new and has been studied in smalltalk for ages (IBM was strong in smalltalk and Sun just hired everyone else).
As an example these two opimizations are a part of both the Sun and IBM JDKs:
1. Virtual method inlining - where a call to a virtual method can be made inline since at runtime we know for sure the instance we perform invocations upon.
2. Runtime loop unroling - loop unroling is mostly useless in C++ since you need to know the size of the iteration in advance. Even if it never changes.
In Java there are many language restrictions (no pointer arithmetics, bound arrays etc...) that allow the JIT to assume things that a C++ compiler can't assume. Java has in that sense the potential to be much faster then Fortran and simpler than C/C++.
> I suppose the best possible world would be to have the
> optimization run exactly once, the first time you install a
> program. (Yeah, you could conceptually move the same
> installation to a different CPU, or add more RAM, or some
> such, but let's not make an already messy issue even
> messier.)
This level of opimization produces some but relatively little benefit. You can do this with open source applications written in C, the advantage in JIT is allowing the application to be profiled according to your specific use case and adapted to it. After all we only use 10% of a programs functionality. When a programmer profiles a C/C++ application he only profiles the way he used it not the way his user will.
Why is it that people like to abuse Moore's law as a lame excuse for lousy engineering?
But seriously, would it kill the poster to include the tiny little fact that gcj stands for "Gnu Compiler for Java?"
Probably not. Nor would it have kill him to explain that a compiler turns source code into a binary executable for a particular architecture, or that IDE stands for Integrated Development Environment, or that a JVM is a Java Virtual Machine, or that RPM stands for Redhat Package Manager, or that GTK+ stands for GIMP ToolKit, or that now it is now used for far more than just GIMP, or that GIMP stands for GNU Image Manipulation Program, or that the included acronym stands for Gnu's Not Unix, or that GNU is a project to write free implementations of operating system components derived around the POSIX model, or that POSIX is a collection of operating system standards based around tradional Unix interfaces.
Doing all of these at once, however, would probably piss everyone off. Explaining just the particular missing piece of information that a specific reader is going to need would be better, but would require Slashdot readers to be more homogenous and Slashdot posters to be more psychic than they are.
The compromise, wherein the word "gcj" is linked to a web page entitled "The GNU compiler for Java", seems to be hard to improve upon.
There's an interesting claim I have seen made: Apparently the late binding feature of object-oriented languages -- virtual methods in C++, any non-static method in Java -- works against branch prediction, effectively resetting the prediction state whenever such a call is made, because the target jump address must be resolved -- read from a memory location -- only at the time of the jump. If this claim is accurate, this means typical OO code is inherently slower to execute than non-OO code on modern processors. Of course, the problem will equally apply to any language that supports function pointers, and in particular to C programs "emulating" OO with structs and function-pointer tables.
Because of the size and footprint issues, you can't do embedded with Java
:-)].
Well...no. I believe that embedded environments are a rather stripped down form of Java, but Java isn't all that uncommon in embedded systems. Take a look at Javacard -- you'd use it in environments where you typically have less than 64KB of memory.
That being said, I *still* think Java is a terrible language for most people to be using. There's something to the argument that there's "not much better out there".
Problem: C sucks for general application development. A lot of people know it really well, but the whole point of C is that you get a lot of control over exactly what's going on [Disclaimer: I like C, and use it for my application development.
Problem: C++ is a *huge* language. I thought I knew it once, after a while using it, and then bought Stroustrop's book, and discovered all sorts of things, like autopointers, that I'd never heard of. C++ has a lot of syntactic overhead.
Problem: C# is made by Microsoft.
Problem: Pascal has vanished into obscurity.
Problem: Perl/Python/Ruby aren't as fast as their traditionally compiled equivalents.
Problem: Nobody uses eiffel.
Problem: Nobody wants to use functional languages, so ocaml and friends are out of the question.
So Java gets used.
I'm firmly of the opinion that Java has a good use -- distributed development.
The problem is that Java was built to make Sun (a hardware company whose primary claim to fame is easy "scalability" by buying higher end machines or more machines) money. Sun's big problem is that most people don't use their SPARC architecture. Java works for Sun by doing two very simple things. It's hideously resource-intensive, from a CPU and memory standpoint. It also is an easy language to easily speed up by throwing more machines into the mix. It doesn't make life a pain if you're using x86 clients with a SPARC server, like rpc can.
Oh, and finally, it has a lot of sexy features to draw people in. It's also a bit easier to learn and work with than C++.
So despite the fact that Java is incredibly slow and RAM-hungry, people bill it as the next big language, the replacement for C++. Frankly, I think Java should stay precisely where its strengths are -- it makes a hella nice language for doing distributed work (especially if you have a client with a front end), and lightweight networking. It's a lousy general purpose language, though.
May we never see th
Just getting a program to run under Eclipse is a major undertaking. Visual Studio has a "project file" that identifies the void main() (or Java or C# equivalent) for you, so if somebody gives you a VS project as a bundle, you simply load the project file and build and run. I think there is something going on with Eclipse that not only to you have to put files into the project manager, you have to identify the source module containing the program entry point for Run to be able to do something, and it is confusing because Run has a lot of options that a person keeps trying out, but the problem was back in the project manager.
I am sure that once you get the hang of how to use Eclipse it is the Swiss Army Knife of software development, but Eclipse is different, and the state of the examples, docs, and help files is such that it is going to turn away of people who try it out for a casual inspection. So be it. If Eclipse gains mindshare, those of us on the fringes will buckle down and try to learn it, and if Eclipse fades into the background, we will kind of know why it had failed.
I never really understood the whole point of the JVM. Why load this big program at every application launch? JIT still has more overhead than AOT compilation, in the real world, and most importantly, the huge memory footprint of the VM wreaks havoc on your caches.
What's the purpose of the JVM?
Dynamicity? No. Java is a aggressively static language. Meanwhile, highly dynamic languages like Lisp, Dylan, and Scheme (among others) can be efficiently compiled to native code.
Speed? While in theory a JIT can be faster, its not the case in practice. In the "Great Computer Language Shootout" (which isn't bad, as far as these things go) Java has an average CPU rank of 14, behind other static languages like C, C++, Ocaml, and SML, and behind dynamic languages like Scheme and CL as well! In reality, Java can only get within 90% of the speed of C for inner-loop numeric-type stuff (which lends itself to JIT optimization).
Flexibility? Java is highly inflexible. Its almost as as inflexible as C. It requires you to manually specify pretty much everything. You even have to do manual boxing/unboxing! Java is so highly structured, it should be compilable to native code that hits 90% the speed of C, without a very smart optimizer at all.
Safety? Given Java's lack of pointer types, it shouldn't need a JVM monitoring it to be safe. Again, there are lots of safe languages (Haskell, Clean, and the aforementioned dynamic languages) that don't require a runtime monitor.
Actually, I don't see much of a point in Java at all. Its got statically typed, but can't use that advantage to be as fast as C++. It runs in a VM, but can't use that advantage to be as dynamic as Python. Its syntax isn't any easier to use than something like Dylan (kinda like Lisp with a Pascal syntax) or Python. It doesn't have the development environment advantages of Smalltalk. Heck, its not even a very good compromise language ---- Dylan is as easy, often faster, and more powerful, Python is much easier (and thanks to Psyco) often as fast, C++ is much more powerful, as well as much faster, etc.
A deep unwavering belief is a sure sign you're missing something...
It is extremely important that *all* developers read the parent post. This IDE may have the most groundshaking features *ever*!
:-)
Let's take a look:
Automatic generation of body files
Hot *damn*! It writes my code for me!
Source code reformatting
Then it reformats it to fit whatever standard I need!
Automatic code fixing
Then it *debugs* the code!
Application builder
Finally, it *builds* the program I'm working on!
All this, from a piece of software that the ignorant layman might consider no more than a wrapper for an editor and a compiler.
Truly, a groundbreaking achievement.
May we never see th
For those who start up their IDE in the morning and close it down in the evening (or at the end of the week, whatever), then long startup times are just a minor cost of doing business.
For someone like me, however, who is ambivalent about this IDE or that IDE, and whose fingers are too hard-wired for one particular editor to use the brain-damaged editors foisted by most IDEs, startup time IS a big issue. When you are going in and out of tools all day long, it becomes a major annoyance to have to wait for the darned thing to start up.
Hey, Windows users, there is no such thing as "forward" slash, there is only slash and backslash.
Often the JVM will out-perform GCJ with a factor of 3. Check out the numbers on this page.
I fail to see why people want to run a GCJ compiled evrsion of a development tool and run at at one third of the speed of the JVM, just in order to save a few seconds of startup time.
A quick test (using an Eclipse 2.1.1 from eclipse.org):
:)
Eclipse 2.1.1 with JVM
- Second start: 13 seconds
- Memory Eclipse: 80 MB
- Memory JVM: 65 MB
Eclipse 2.0.1 without JVM
- Second start: 9 seconds
- Memory: 96 MB
The download page seems to indicate you're downloading an Eclipse 2.1.0 version, but the about dialog says 2.0.1. Which one is it?
Cheers,
Thimo (back to coding in Eclipse 2.1.1
Avoid the Gates of Hell. Use Linux!
I could show you plenty of examples of benchmarks that run significantly faster with GCJ than on the IBM JDK. Its true that there are still some occasions where GCJ will run slower - due to bottlenecks in the runtime or missed optimizations in the compiler. But if you have a simple application that runs significantly slower with GCJ, please write to java@gcc.gnu.org and tell us about it. We can't fix performance problems we don't know about.
Eclipse contains a java compiler which you can also compile as a standalone app with with gcj (see http://sources.redhat.com/rhug). The gcj-compiled compiler is almost three times faster than the latest IBM JRE run version.
Get your torrent here
You can have a JVM that can save JIT output to the executable format for a given platform. Like GCJ :-) Then, after a bootstrap, the JVM can be in fact written in Java.
Just so you all know. A good jit/hotspot compiler can make things quite a bit faster than any static build compiler. This is because at runtime certain optimizations are possible that simply cannot be done at build. These optimizations are typically very aggressive, to that extent that later on in execution it may turn out so that those snippets have to be thrown away and recompiled. And thus they usually target only the hotspots, i.e. portions of code that are being executed inside tight loops, which is usually where compile time savings occur anyway. The speed of the rest of the code is pretty much governed by the programmer anyway along with his choice of algorithms and data structures.
A good example of such snippets would be the inlining of a virtual method, turning a virtual method recursion into a loop along with some unrolling, inlining function pointer call (which is basically the same as virtual method call).
Mind you, ofcourse a hotspot compiler could also be implemented to a C/C++ runtime environments, but I haven't heard of anyone actually taking that path.
(for the record, I'm a C programmer and rarerly write much with java)
1 Earth is warming, 2 It's us, 3 it's royally bad, 4 we need to take action NOW