7 Apr 2008 tan   » (Journeyer)

Hi all,

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?

  • I can use some nice, high-level language; but I do not want to restrict reuse opportunities with the age-old "how sad this is coded in X when I'm coding in Y, I'll have to port/rewrite it".
  • I could code it using C, and provide bindings for some higher-level languages (which, I suppose, excludes C++ from the loop, as it's more difficult to bind to anything else than C). But as good as this is from a reuse point of view, and even if I'm a capable C coder, that is definitively a productivity killer and a sad jump in the past (no offence intended to enthusiast C coders, but I'm kind of accustomed to OOP, generics and automatic memory management now).

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?


Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

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!