Coding The Future Linux Desktop [updated] 700
the.jedi writes "With the release of GTK+ 2.4, and Gnome 2.6 due out some time next week, it seems of some the Gnome developers are looking at how they'll be coding Gnome and the rest of the Linux desktop. Havoc Pennington of Planet Gnome has written a short blog pondering and analyzing the available options as coders move towards high-level languages like java and C#. He gives a good overview and assessment of technologies like mono, OO.org's UNO framework, as well as other ways of tying new languages to the existing code base. An extremely interesting read for desktop linux hackers everywhere."
Update: 03/17 14:44 GMT by T : Speaking of the future of Gnome, aeneas writes with a list of Gnome 2.6 release parties around the world (linked from gnome.org/start/2.5).
Hey, wait a minute.... (Score:2, Informative)
Did you guys switch the polarity on the temporal transducer again? It's *LIKE* a re-post, but not.
Here ya' go, from yesterday. [slashdot.org]
XUL (Score:4, Informative)
Michel
Re:How about still using C (Score:1, Informative)
Re:How about still using C (Score:2, Informative)
Re:Does the new release improve the X performance? (Score:1, Informative)
The problem is not on Gtk. Gtk makes use of a double buffer to avoid flickering. That's not bad, but it brings an X Window design decission to the surface.
When using X over a network, it always transfers ALL the screen to the clients, even the static parts.
The addition of the XDamage [freedesktop.org] extension to X servers allows the X protocol to transfer _only_ the screen changes over the network. Less transferred data, less network use, more speed.
I can't wait for the Freedesktop [freedesktop.org] X server to be production quality.
OK, you convinced me; here's my contribution (Score:1, Informative)
Also, a couple years ago, I experimented with gnome's corba implementation, Orbit. It was pretty darn lightweight and fast. Since then, Orbit [gnome.org] has made so much progress, maybe I should have a look at it again, and see how hard it'd be to add support for that to crosstool, so Corba could be an easy option for people using crosstool-generated toolchains.
Re:What happened... (Score:3, Informative)
Err...it hasn't changed a bit. They added support for one more language, to the other ones out there. A lot of people that bitterly hate C# went nuts over it, and have been happily misquoting Miguel and thinking that the sky is falling.
If you don't like to use C#...hey, don't use it! Use C, or C++, or perl, or Java, or whatever language you like to code GNOME apps in. If you like Lisp languages, look at cl-gtk or clg.
Re:How about still using C (Score:3, Informative)
Re:Does the new release improve the X performance? (Score:5, Informative)
A big part of the slowness of gtk2 is font rendering. Motif uses (or used?) XDrawString(), so text was done entirely by the server. On the downside, the quality of the text rendering was very poor.
gtk2 draws all text with pango. Pango is a high-quality unicode text renderer with an Xft2 backend. If you have an old X server, this can be pretty slow. If you have a recent XRender extension, it's almost as fast as the old XDrawString().
Owen Taylor did add an optimisation to render text more quickly for text which gtk knows is being drawn over a plain background, this helps old X servers a lot, provided you're not using a pixmap-based theme.
Re:How about still using C (Score:5, Informative)
At 8mb on my system (that includes the java class library) that's pretty light. For comparison .NET on Windows weighs in at about 30mb and the Mono RPM (compressed) is about 8mb as well, so it's certainly competitive.
+5 Insightful (Score:4, Informative)
Yup.
Java/C# are snazzy for:
* Custom application development
* Lightweight distributed and networked systems.
* (Java at least) Cross-platform GUI apps.
* Vertical market software development.
C/C+ are snazzy for:
* Libraries
* Horizontal market applications
Until Microsoft goes out and rewrites MS SQL Server, MSIE, and Microsoft Word in C# (not going to happen, for good reasons), I don't see any reason why there should be any interest in doing the same with the core GNOME apps.
The same goes for Sun and Java. When Sun decides that Java would make a really great language for Open Office and successfully writes an efficient Java-based Office release, then it might be worthwhile considering Java for said use.
Until then, I'd suggest rnning out and actually *using* one of the desktop apps that people have written with Java. Hey...they're slow, RAM-hungry, and annoying to run on systems with different JVMs.
There have been a zillion less efficient languages proposed to replace C (and later C++) over the years. All of them failed to replace C/C++ as a general application programming language. Efficiency matters. The fact that Microsoft is pusshing a high level language and Sun is pushing a high level language (at other people -- notice failure of Wordperfect Java port for an example of why Java/C# are not good choices for horizontal market apps) does not mean that *this* year is the time to move to a high level language. I don't think anyone here wants GNOME or KDE to have a *bigger* RAM footprint, which Java would do.
Re:How about still using C (Score:4, Informative)
1) Mozilla and OO are written in C++ not Java or C#
2) Java on a modern hotspot JVM can outperform the equivalent C++ code for stuff that isn't IO limited (ie number crunching stuff)
3) GCJ compiles Java to native code anyway.
I'm not sure I see your point.
Re:GNOME is GNU. Mono is hostile to GNU. (Score:2, Informative)
Re:GNOME is GNU. Mono is hostile to GNU. (Score:3, Informative)
We think we have a better implementation so we keep going forward with that. I don't think we're even competing since DotGNU seems to have different targets than us: for example the reason we built a JIT from the start is because we want Mono to be an efficient developer platform that enables people to move away from unsafe and difficult to use langauges: this of course would be not compatible with an interpreter design which is slow. By all means continue with the DotGNU implementation, improve it and try to build on its strengths, but don't just call us hostile only because we have a different implementation from yours.
Re:XAML or ???? (Score:3, Informative)
XUL [mozilla.org] already exists. XAML is a XUL feel-alike, like C# is to Java.
Pah. It always takes Microsoft to bring already-existing ideas into the spotlight.
Re:Python and large desktop apps (Score:4, Informative)
Nasty type errors are really rare, though. Normally, you've either done something stupid and the code doesn't run at all (and you have to test everything at least once), or the types are right.
Of course, some languages can be really helpful with their type checking. Haskell often gives some insight into the nature of some code by giving it a more general type. But I find Java tells you nothing you didn't already know.
Python has a few other problems. It's (a) slow even with tools like Psyco.
I've looked at the output of some code from psyco and it looked just like C (provided you stick to C-compatible types, of course). Python tends to off-load critical loops into C libraries (map(), etc). Java tends to be much slower, perhaps because most of its standard library is interpreted?
Re:How about still using C (Score:4, Informative)
Re:How about still using C (Score:3, Informative)
It all comes down to time: development time, and maintenance time. C is a costly language, and companies don't want to pay for it.
Re:Python and large desktop apps (Score:3, Informative)
Not in Python - it's as natural as eating or sex
The more code can be automatically verified and checked, the better IMHO.
That's why there should be tests that excercise your code. Static typing helps catch some trivial bugs, but it only goes so far.
It's (a) slow even with tools like Psyco a
I think this is the reason it's not considered for OO.org scale programs. Desktop programs need to be very snappy, and Python takes a hit here. Less so because of the size or scalability. google for Chandler @ OSAF.
has a wierd non-C like syntax which is a bit offputting for people who are used to C++/Java/C# style languages.
The syntax is not "weird". Actually it's much more natural than in C family languages. And someone who can't get used to a new kind of syntax of such simplicity is probably quite stupid and should not be programming anyway (note that I'm emphatically *not* referring to you here, so ease up on the flamethrower
Re:How about still using C (Score:3, Informative)
For example, GCC compiles per file. It doesn't compile the project as a whole, so it can't perform cross-module optimisations.
Another example, how do you efficiently optimise a library statically? Not only that, but the behaviour of the application might depend upon, for example, a read-in piece of text (to determine, for example, if it logged or not). A sophisticated JIT can then generate more optimised code than a C++ compiler over time.
There are loads of cases where a JIT can outperform a static compiler. That's not to say that static compilers don't have a large number of strengths, or can't be modified to overcome a large number of these weaknesses (whole program compilation is already pretty much there for gcj, adding it to the gcc in total might not be that difficult, likewise a runtime profiler could rely on static hints for places that might be good to optimise, akin to dynamo). But at the moment, JITs don't necessarily lose out.
System.Windows.Forms and mono (Score:4, Informative)
(which is also why Microsoft is backing off of S.W.F themselves; the whole point of them going with
That said, mono is in fact working on a S.W.F implementation in conjunction with Wine.
And no mention of D... (Score:3, Informative)
This seems like a natural fit for developing desktop applications that don't feel like they're running under a VM, yet they are still garbage collected.
Re:How about still using C (Score:3, Informative)
Oh wait, they aren't! Metacity is the one that's written to be run anywhere in the world.
Honestly, if there was another GTK+ 2 window manager with all the Gnome hooks built into it to compare it to, then you'd have a platform to stand on.
Otherwise, you may as well be saying 'd00d WTF!!! why is Doom III so much slower than Wolfenstein 3D???? id is t3h sloppy coding!!11!'
Amen brotha! (Score:1, Informative)
A GNOME Developer speaks - c&p from OSNews (Score:1, Informative)
Such editorials are hard to take serious since they are build up on basicly NO deeper knowledge of the matter. Most people I met so far are full of prejudices and seek for excuses or explaination why they prefer the one over the other while in reality they have no slightest clue on what parameters they compare the things.
If people do like the gance ICONS over the functionality then it's quite ok but that's absolutely NO framework to do such comparisons.
I do come from the GNOME architecture and spent the last 5 years on it. I also spent a lot of time (nearly 1 year now if I sum everything up) on KDE 3.x architecture including the latest KDE 3.2 (please note I still do use GNOME and I am up to CVS 2.6 release myself).
Although calling myself a GNOME vetaran I am also not shy to criticise GNOME and I do this in the public as well. Ok I got told from a couple of people if I don't like GNOME that I simply should switch and so on. But these are usually people who have a tunnelview and do not want to see or understand the problems around GNOME.
Speaking as a developer with nearly 23years of programming skills on my back I can tell you that GNOME may look polished on the first view but on the second view it isn't.
Technically GNOME is quite a messy architecture with a lot of unfinished, half polished and half working stuff inside. Given here are examples like broken gnome-vfs, half implementations of things (GStreamer still half implemented into GNOME (if you can call it an implementation at all)) rapid changes of things that make it hard for developers to catch up and a never ending bughunting. While it is questionable if some stuff can simply be fixed with patches while it's more required to publicly talk about the Framework itself.
Sure GNOME will become better but the time developers spent fixing all the stuff is the time that speaks for KDE to really improve it with needed features. We here on GNOME are only walking in the circle but don't have a real progress in true usability (not that farce people talk to one person and then to the next). Real usability here is using the features provided by the architecture that is when I as scientists want to do UML stuff that I seriously find an application written for that framework that can do it. When I eye over to the KDE architecture then as strange it sounds I do find more of these needed tools than I can find on GNOME. This can be continued in many areas where I find more scientific Software to do my work and Software that works reliable and not crash or misbehave or behave unexpected.
Comparing Nautilus with Konqueror is pure nonsense, comparing GNOME with KDE is even bigger nonsense. If we get a team of developers on a Table and discuss all the crap we find between KDE and GNOME then I can tell from own experience that the answer is clearly that GNOME will fail horrible here.
We still have many issues on GNOME which are Framework related. We now got the new Fileselector but yet they still act differently in each app. Some still have the old Fileselector, some the new Fileselector, some appearance of new Fileselectors are differently than in other apps that use the new Fileselector code and so on. When people talk about polish and consistency, then I like to ask what kind of consistency and polish is this ? We still have a couple of different ways to open Window in GNOME.
- GTK-Application-Window,
- BonoboUI Window,
- GnomeUI Window,
Then a lot of stuff inside GNOME are hardcoded UI's, some are using *.glade files (not to mention that GLADE the interface buil
A Mono developer's perpective (Score:4, Informative)
I'll try to address some of the issues Havoc presented. Of course, I'm a Mono developer, so I'm biased, but hopefully people can see my arguments are more on the technical side than advocacy.
No rewrites please: this is a very important point: we can't just throw away the current code: we need incremental changes to not disrupt stability and compatibility. I'll just note that using Mono (and C#), interoperability with existing C code is much easier than with Java because of P/Invoke.
Calling managed code from C/C++: Havoc says it's hard, but Mono provides an easy to use interface to do that. Mono is designed to be embedded in existing applications, not just as a runtime for standalone completely managed programs. Also, it would be easy to create a shared library and header files to access managed methods seamlessly: they can be automatically generated thanks to the use of Reflection and the Mono embedding API.
I'm not sure a "simple native component system bridge" would solve the issues, mostly because simple systems are always found later to be incomplete, they get changed and become big, but with all the design warts needed to make a simple design work for not-so-simple constraints.
A minimal Mono system is currently about 2 MB on disk, but no effort yet has been put into reducing it (and I think it's entirely possible, we have been busy implementing features and leaving aside space optimizations). Of course, since the default build of the core assembly has lots of features, much of the reduction in size could be achieved by trimming features that other systems don't have:-). Even without trimming, most people will concour that 2 megabytes of disk space for a shared component is small enough in a desktop setting (and applications compiled to IL code are usually much smaller than comparable C apps anyway).
Community should decide: of course, I agree. Anything that is pushed down our throats by somebody else is not going to work for the free software and open source communities. The solution will need to be choosen because it actually solves issues the developers and the users see. Java had several years to try to attract developers from our community and it had some success in some niche areas (not for desktop applications, though). Mono has just started, but from the comments of the developers that actually used it to write new applications or port existing ones from C, it looks like we are on a good adoption path (even though we didn't release a 1.0 version yet, we are still working on debugging support and documentation is sparse).
Havoc fears the adoption of Mono or Java for the desktop would alienate people and cause forks. I don't think that will happen with Mono, because Gnome will continue to have a diversity of developers who'll prefer using the C libraries directly: Mono allows to keep and interoperate with existing code very easily and we want the migration to happen incrementally, so at first only end-user applications would be written in managed code, while the foundation would still be in C (at least, enough of the foundation to have people happyly writing their own apps in c or with the existing bindings). At that point, when a managed execution environment has proven itself to both developers and users (hopefully) we could start discussing about using it for the foundation, too, if that makes sense. I think Mono is positioned better here to allow this incremental shift of both development and espectations towards a managed runtime.
Problems with a .Net clone: Havoc claims that MS controls the platform
because, even if the core is unencumbered, some assemblies are tied to MS
technologies and there is non standards body or community momentum to build
alternative solutions for a complete platform. Well, considering that until
a couple of months ago there were 5 people developing mono, we have achieved a lot,
not only in the implementation of the runtime, but also, thanks to the large
commun
Re:How about still using C (Score:3, Informative)
to get that out of the way: yes, java memory use is ridiculous, and Sun needs to do something about it. 16M overhead for _any_ app is not going to cut it. memory use is on top of the list for requests for enhancement [sun.com], so i expect significant movement there soon.
I'll say _you_, then, haven't spent days debugging a Java memory leak.
i have. yes, the garbage collector does not free you of all worries. and especially with the listener model you will run into gc issues quick. unless you use WeakReference and simply _never_ have that problem (WeakReferences are references that do not prevent garbage collection - it's a way to make Java behave like C, exept that you don't have to dealloc - the garbage collector takes care of that for you)
using WeakReference where appropriate, you can have the cake and eat it, too.
Sun should really emphasize this more in the docs. But i wonder what the alternative is? No garbage collector? Surely, that's worse.
4. It also has horrible startup time - i think that has to do with RAM usage. it takes a while to fill 25M... so if the RAM problem goes away, this one will go away, too.
5 Swing is slow... Not true. Swing (caveat: on windows!) is hardware accelerated [sun.com]. E.g. it takes advantage of the graphics card, just like native apps do. That it hand-paints everything is java mythology. It was true a long time ago. [caveat: i think it might still be true on non-windows platforms]
6. It also requires quite a bit of clue to use well....
Point taken.
Swing is a relatively weak framework, some call it over-engineered, i just think it was done by people with little experience in designing GUI frameworks. On the upside, it does have a lot of things built-in.
Bottom line is, Swing is a memory hog, and the architecture (or at least the tutorials) could be better, but it is fast, and it works very well.
Both memory usage and startup time are not inherent to Java/Swing, and i am convinced that both can be improved and will be improved in the near future (1.5).
Not to mention it's cross-platform
The latter means that all apps i write for my company will also run on Linux. Even though that is not a requirement for any of them (and i certainly would not get any resources allocated to do a port).
Re:Next week I will be coding the Linux desktop: (Score:3, Informative)
D as an example. (Score:2, Informative)
http://www.digitalmars.com/d/