Name: Olivier Parisy
Member since: 2006-07-27 21:26:59
Last Login: 2008-09-04 10:23:49
Notes: Just a no-fuss diary I use to keep some notes. May be useful to others too?
I'm currently toying with native compilation as a way to integrate java open source apps to Win32.
Tom Tromey just posted on the gcj mailing-list a link to an interesting Java to C benchmark. It's actually a followup to a previous one, to which other Java runtimes have been added.
Basically, that's a comparison of micro-benchmarks between some "classical" (JITed) Java environments, compiled ones (GCJ and JET) and the equivalent C programs.
As I understand it, the results show that comparing Java to C performance-wise does not have much meaning. Depending on the task at hand, Java timings are in a +30% to -30% interval with respect to C performances.
If such a worn-out subject interest you, I would recommend reading the classical "An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl". I suppose some shootout results would be a nice read too (their FAQ is a must-read). Oh, look, there's even a detailed wikipedia page about languages comparison.
My Dream Language
I'm actually more interested, as stated in my previous post, by what may or may not help a library to gain acceptance. Execution time of "scripted" or VM-based languages is a typical FUD; runtime memory usage is more of a concern (especially when compiling to native). Linking to other languages is probably what matters more, actually. That's the only argument I could imagine in favor of C.
For application writing, it's clear to me that using a garbare-collected, multi-paradigms language (especially with a rich functional expressiveness) is a no-brainer, from a productivity and maintainability point of view. But for maximum reuse, what's needed is multiple, clearly-defined libraries. For which I'm afraid no perfect implementation environment exists.
I would love the above high-level characteristics (which rules out C, C++ and to a lesser extend Java), easy linking with existing C libraries (that one is OK with most languages), and natural, efficient reuse from other popular languages and environments (Java, C#, C++, Python and PHP easily come to mind).
Now I'm getting Boring
Ahh, the good old Graal of universal, transparent componentry... Perhaps some agnostic glue is needed... CORBA failed us, Web Services are overkill to fit together applicative components... Wouldn't D-BUS be more interesting in this case (but calls granularity should be properly thought out)?
So which paradigm/language/framework could provide us with some kind of universal "software mashup"? Any opinion (or better, bibliography) on this matter, which I feel is quite the opposite of a language comparison (would you fear the trolling)? Am I getting boring? :-)
If You're still with me
In (not so) other news, I noticed a revised edition of the Dragon Book was available. Among the new topics are better code analyze and optimization, JIT compiling, garbage collecting... I need this (pricy) beast!
I've been toying with the idea of implementing some networking protocol stuff for some time now. That was actually one of my motivations for working with native compilation of Java code to Win32 platform, but that proved disappointing. J2SE has a big, tightly coupled runtime / libraries set, and it seems difficult to produce lean and mean binaries out of it (that's my current experience anyway).
In the mean time since my last post on this matter, more than a year and a half ago, I gradually understood Java was not the weapon of choice for small, nicely desktop integrated tools (please disprove me!). It can be done, but I feel it goes against Java basic design decisions, which mean you're then kind of fighting against your platform. Productivity killer. Baaad.
So I'm kind of confused. What I want to do is some networking code. I will develop it as one or some libraries, and build some apps above it, since I feel there's nothing sadder that a great idea intermixed with some application code (at the end of the day, if someone want to reuse it, he'll spend a hell of a time figuring out which parts he actually needs).
The apps will be coded in a nice, productive language (I lean toward Python, or perhaps something more exotic to me like Factor).
The libraries would be coded under an LGPL or BSD license, for best reuse; but which language would you choose?
There's no win/win solution here, I'm afraid. So I'd like to get your opinion on this matter of maximum reuse / acceptation of a library, at the cost of language expressiveness.
On a related note: should I code in C, I'd prefer to use a portable foundation library since I'd like to target at least the linux and Win32 platform. It would be that less low-level details to bother with. It seems like the Apache Portable Runtime is a good candidate. Does it provide an NIO/select-like abstraction (event-driven networking)? Are there other similar platform-abstraction toolkits you could hint me to?
Regards.
Anyway, a canonical SWT "HelloWorld" now works properly, as well as the tray variation I've initially chosen as a simple example.
Now that this code compiles and runs properly, I'm focusing on its packaging. NSIS seems like an obvious choice, but I'd first like to "clean" my compiled app.
Indeed, I'm kind of surprised by its size; this basic example weights 52MB. Stripping it and compressing it with the excellent UPX leads to a 4MB executable, but it still does feel like an awful lot. Perhaps some code analysis could remove unneeded parts? I'll have to goggle about this.
I then had a fun little time disassembling the resulting library to ensure this flag had the desired effect (I used REC for this purpose, a nice but sadly not open-sourced software).
Well, it did, but this did not solve my crashing issues. At this point, it seems like I really should study and trace gcj's stack unwinding code...
So I need to build an SWT DLL using a specific flag (-fno-omit-frame-pointer). Otherwise, the unwinding code (whatever kind of stack-walking thingy that may be) get confused.
I've actually been able to build a working DLL, but I had to use the standard Windows toolchain (which, surprisingly to me, I could download for free). Adapting those makefiles to gcj will be an interesting exercise...
I'd never thought my desire to integrate open source java software to Windows would lead me to the installation and fiddling with of so much Microsoft tools...
tan certified others as follows:
Others have certified tan as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!