Slashdot Mirror


Seeking Multi-Platform I/O Libraries?

An Anonymous Coward asks: "I'm just getting ready to plunge into a new project, and joy of joys have been given complete freedom when it comes to the implementation language - so long as the program will build and run on both x86 Linux and Windows. Now, I don't need a GUI, this is systems stuff only (processing binary executables in fact, so lots of bitfiddling and big nasty algorithms over hairy data structures) so pretty much all I need are standard IO libraries. C is currently at the top of my list..but what other language should I be looking at? I'm happy to learn a new one, and have the go ahead to do it..like I say, they want absolute speed. Can someone suggest a better language? C++ is out, it does come with a speed hit (using C++ properly anyway, not as a souped-up C). If I'm gonna take the speed hit, I may as well consider something like Ocaml which might let me claw the speed back with better algorithms and data structures.."

4 of 88 comments (clear)

  1. c++ is out? by Aniquel · · Score: 5, Insightful

    I'm really very curious why you decided that c++ is out. I understand that the common (mis)perception is that c++ is slower - but let me ask this: Have you ever benchmarked it? If not, then I strongly suggest that you don't discount c++ out of hand. It has the cross-platform io facility of which you speak (streams), already has all the (completely debugged) algorithms and advanced data structures. Look, nothing is going to be faster than c (except for hand-tuned assembly) - If you absolutely need every little bit of performance, then don't bother with a language other than c. But, if you're looking for a language nearly as fast, with a complete template and streams library, that's portable, then you ought to seriously consider c++. (btw, I've written extensive projects in c++ (25000+ lines) - There isn't much performance difference, and the benefits to using it far outweigh any other penalties.)

  2. more than just a language performance question... by CaptainAbstraction · · Score: 5, Insightful

    This is more than just a language question. It looks like you're starting to get the standard responses already for Java, C++, etc.

    But all of these opinions presume that you're fairly experienced in these languages. Ignore them.

    Language experience/familiarity is THE factor here, so don't discount it. Someone who has been eating and breathing Java would likely produce speedier code than someone who is just learning C, for example.

    Your employer/client wants SPEED. This project involves hairy and complicated bit fiddling. I would suggest NOT using this project to learn a new language, for the risks outweigh the rewards in this situation.

    If you choose to use a new langauge for this critical job, you're setting yourself up for disappoint. Do not forget that you're going to have to go through the all the growing pains associated with a new langauge. You're going to spend weekends tracking down (and learning from) all the newbie mistakes one makes with a new langauge. You are going to encounter new and unfamiliar bugs at all levels - logical design, physical design, semantic, syntactic.

    Do you really want to spend your nights and weekends figuring out what the heck is throwing some particular JAVA exception seamingly at random? Why your C++ function template specialization is being ignored?

    Learning a new language is exhilarating, but that will quickly turn to FRUSTRATION when you run into that weekend-long show-stopper bug.

    With your product being measured by performance, and with deadlines looming... When it comes down to crunch-time, I think the choice is OBVIOUS!!

    Choose a different, fun project to learn a new language. But for this product you're delivering, I would encourage you to stick with the tools you know and love.

    Best,
    Captain Abstraction

  3. Use C by mccalli · · Score: 5, Funny
    Looking for an IO library standard across platforms?

    #include <stdio.h>

    Says it all really.

    Cheers,
    Ian

  4. wow by sinserve · · Score: 5, Funny

    Your "speed" priority, and the binary processing bit, got me almost sold, and then
    I saw O'Caml!!

    You quiche eating wanker, how COULD you forget assembly? Isn't that what programming is
    all about? And WHY are you comparing C to O'Caml, a fine assembly macro language, to
    shity ML dialect used by equally hard-wanking mathematicians and abstractly thinking
    creatures? If these wankmaticians knew how the world operated, they would not
    have invented recursion let alone APPROVED of inductions as a sane, corner stone
    princible in their so called "art". Induction is only possible as long as the
    the "counter" register can hold your index, and recurssion is the crackwhore narcessistic
    twin sister of iteration (there is nothing she does, iteration can't do with
    a well placed label and a jump.)

    Listen to me son, read Quine, Boole and DeMorgan, get the manual to your processor,
    and "script" at the level of the ONE TRUE ABSTRACTION LAYER.