[Beowulf] Which is better GNU C or JAVA (for network programing)
atp at piskorski.com
Tue Jan 20 17:47:46 EST 2004
On Tue, Jan 20, 2004 at 08:05:45AM -0500, Robert G. Brown wrote:
> On Mon, 19 Jan 2004, prakash borade wrote:
> > can anybody tell me
> > what do i choose for programing
> > either GNU c or JAVA for implementing some
> > networkprograms using some linux systemcalls
Hehe. Um, is any of this supposed to be Beowulf related?
> Gads, that's two questions in two days with the distinct whiff of crowds
> of screaming peasants waving swords and torches...
> Now we can give the correct answer, which is "C".
> W. Richard Stevens, Networking God (deceased):
Excellent advice. The three books of his that I have are very good.
Now, my own contribution to the jihad. :) None of this is
particularly specific to "network programs" by the way:
The conventional wisdom is that C is a "portable assembly language"
for low-level bit twiddling, performance criticial library functions,
and writing byte code compiles for scripting languages, and my own
experience seems to bear that out.
So, IMNSHO, you don't want to do all your programaming in C, you don't
even want to do most of your programming in C. In fact, C should
viewed like habaneros, or perhaps caviar - use where needed and called
for, no more. So what other language to use? Well:
- For any project of reasonable size, you HAVE to know C, because it
is ubiquitous, and you will have to use it somewhere. (Your OS calls
are in C, 95% of the other APIs you'll want to call are in C,
- Therefore pick a very high level language suitable for the most
rapid development possible, and use that for as much of your code as
possible. But the ability to easily interface with C is also very
- Use C only where you really need it, which means: 1) Small amounts
of performance critical code. 2) Where you have to in order to talk
to other C code - vast numbers of 3rd paty libraries, etc.
- For the "very high level language", so far I've found that a
scripting language like Tcl works very well. (For more math and
especially statistics intensive use, S/S-Plus/R can be good.)
- Proper use of an RDBMS (Oracle, PostgreSQL, etc.) can make a huge
difference, as it provides a high level interface to many powerful
features that are hard to find elsewhere - ACIDity, concurrency,
constraints to enforce data correctness, etc.
A corrolary of the above is that Java isn't interesting. Java is
higher level than C but not very much. I'm already using C for any
really low level stuff, I want something a LOT higher level for
anything else. Java would probably look pretty attractive if doing
ALL my coding in C was my only other option, but it isn't. Therefore,
my very limited contact with Java says, Java isn't it.
There you go, the answer is Tcl. :) With it's Threads Extension (or
in AOLserver), it's particularly fabulous for multi-threaded
programming. (Ironically, Tcl guru's have traditonally emphasized
concurrent programming using the event loop rather than threads.) And
I can always drop down and implement a new Tcl command in C if I need
I've heard other potential answers ("Standard ML for everything!", "we
just need a new Lisp dialect..."), but about those, well, I can't
Andrew Piskorski <atp at piskorski.com>
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
More information about the Beowulf