in reply to Is Perl right for me?

Leaving aside my tendency to complain about bad spelling and grammar, I would suggest that for most problems a good compiled language (Fortran compilers have beaten very skilled assembly language programmers for about 40 years; I see little reason why C/C++ wouldn't do as well) will beat even the best hand-coded assembler for many classes of problems, which will beat Perl, Python, Ruby, or Java. In computationally-intense problems, Perl, Python, Ruby, or Java will probably be approximately equal. Whether they are adequate for your needs is a different question, but my guess is that if one of them is, any of them will be.

Note, however, that Perl, Python, Ruby, and Java are largely designed to be platform-neutral, and the coding you're describing seems to require some fairly low-level twiddling, which probably is quite platform-dependent, so it will probably require some C (or assembly) to manage the platform-dependent bits. Conveniently, production-quality modules for your tasks may exist on CPAN, and they may be production quality across platforms.

I like Perl; I find it has more than sufficient performance for 90% of the coding I do. The odd 10% is computationally intensive, so none of Perl, Python1, Ruby, or Java quite cut it.


1 For aesthetic reasons, I don't like Python, so I have essentially no experience with it.


Information about American English usage here and here. Floating point issues? Please read this before posting. — emc

Replies are listed 'Best First'.
Re^2: Is Perl right for me?
by gone2015 (Deacon) on Jan 14, 2009 at 15:55 UTC
    I would suggest that for most problems a good compiled language (Fortran compilers have beaten very skilled assembly language programmers for about 40 years; I see little reason why C/C++ wouldn't do as well) will beat even the best hand-coded assembler for many classes of problems

    Are you making the claim about assembler for programming time or for run time ? Or size ?

    If run time and/or size...

    Code generation has become better and better. Processors have become better at supporting code generators. Processors have become more complex, so that to get the most out of them you need to worry about the relationship between instructions -- instruction scheduling is hard work for the average human. So these days it's effectively impossible to cost justify assembler vs C -- cycles and RAM are cheap and plentiful, and next year even cheaper and more plentiful.

    I suppose with specialist vector processors and such, even FORTRAN could out-instruction-schedule a human. I've no experience with such heavy duty scientific iron.

    However, as a bare-knuckle assembler black-belt, I'd have been flabbergasted not to be able to out-run a compiler 20 years ago, let alone 40. I don't want to start an OT religious war... but I must ask if you have evidence for your assertions ?

    Does anyone have a section of code that is so time critical it's worth casting into assembler ? I have a hankering to go mano-a-mano with some real code !

      It's anecdotal, or at least I've never seen the documentation of the performance of FORTRAN1 vs assembler; I suspect that it was on IBM platforms, for code fragments, when John Backus was still active.

      On the other hand, it is, inarguably, more portable than assembler. I even have a good story about that ;-).


      1  Also, it's no longer FORTRAN; this was changed in the Fortran 90 standard.


      Information about American English usage here and here. Floating point issues? Please read this before posting. — emc

        Oh, Inline::C I love Perl now ^^
        All the functions of C and Perl. As for speed I think Perl is just fine.
        But you are right, I'll just install perl on my Laptop and'll start coding some small Math programs to get the hang of it.
        If I decide I don't like it I'll shuck it out.
Re^2: Is Perl right for me?
by RobinV (Sexton) on Jan 14, 2009 at 14:16 UTC
    @oshalla
    I understand that perl is Interpreted.
    I noticed that Perl is a lot faster then Java or Python (Faster as in Efficent memory use, I forgot to put that in there aswell).
    I do not want to write inline C but it would be really usefull.
    Umm, Ill look a bit more in the INLINE Cpan functions.
    I fell for cpan since its a clear way to find functions and a good documented page.
    Since Perl is a Scripting language it will work on both Platforms without to much fiddle (atleast I hope).
    And thats why I love CPAN, sometimes in C you have problems with functions in other OSes.

    Thanks for your reply I'll look more into it.

    @swampyankee
    I am sorry about any Gramar mistakes. I have the problem that I am very Dyslectic and I don't know why the text is formatted that bad.
    Since I did write it with Enters and Such (\x0A\x0D ;)).
    I do indeed a lot of Low Level stuff. Stuff on low levels like TCP and Memory Addresses. But I understand that when its Platform Aimed I would do it in C anyway.
    Or I would do it in a language from the platform (Like C#) anyway.

    @All,
    I think that I came off a bit like a SpeedNut. For speed I would not need to much. I just want to cut down on my Coding time on all my small projects.
    Thats why I want to switch to Scripting from Compiling.

    I once started with my own scripting language. (developing one) but I thought it was quite pointless since there is such a huge pile of scriptinglanguages out there.
    I'd just love to be able to execute Opcodes anyway though. But as I see there is a Inline::Asm I guess that its posible.

    Thanks already. Anymore ideas / tips / comments?

    Cheers,
    Robin

      As I said, I find that 90% of the time Perl's performance is adequate for my needs, or (more importantly) those of my employers. In the odd 10% of the time that Perl wouldn't give the required performance, I doubt if any of its direct competitors could, either. Perl may have adequate performance for your needs; you would probably, as said by oshalla need to use Inline::C to handle the low-level interactions. I'd suggest trying it; the initial price is cheap, and I think Perl's documentation is good, although the documentation of CPAN modules varies from non-existent to quite good.

      As for the grammar and spelling issues, my younger daughter (now a college freshman) had 10 years of speech therapy and is LD; she's the one who has labeled me a grammar nazi.


      Information about American English usage here and here. Floating point issues? Please read this before posting. — emc