Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: I want you to convince me to learn Perl

by Marshall (Canon)
on Sep 25, 2013 at 11:20 UTC ( [id://1055663]=note: print w/replies, xml ) Need Help??


in reply to I want you to convince me to learn Perl

So, I'm an embedded firmware engineer who lives in the realm of C 99% of the time, and I am trying to decide on a scripting language to use for general work around my system.

Perl can do everything that C can do (albeit a bit slower, but not by much). Basically Perl code will run about 1/3 the speed, but you can write it 10x+ faster.

If you go to Fry's, all of the software is written in C. Nothing is written in JAVA. Nothing is written in Python or Perl either. However many huge websites are written in Perl. As a firmware engineer, I would recommend Perl. I've written binary processing stuff in Perl and there are folks here that can help with that.

I recommend Perl.

  • Comment on Re: I want you to convince me to learn Perl

Replies are listed 'Best First'.
Re^2: I want you to convince me to learn Perl
by Tux (Canon) on Sep 25, 2013 at 12:11 UTC

    Writing perl^W^WEfficiently writing in perl in fact is so effective that I(/you) will take the speed issue for granted when most of what you write is for one-time use or for use that doesn't require the speed. I write perl and C and Java everyday and curse at C and Java quite a lot for not allowing me to write «my $c = 1;» instead of «int c = 1;» or «private static long c = 1;» or whatever it takes for a local/lexical variable to get in scope.

    I find myself write less and less C as I can do almost anything in perl, and write it over ten times as fast in code that is easier to maintain. Some projects however still need perl: the code cannot be shared by law and perl has no good code-hiding feature.

    Defining a useful data model in C might be quite a challenge. The autovivication in perl is a joy compared to how to deal with data in C and - even worse - in Java.

    Compared to C and Java, changing data-structures, return types etc is so much easier.

    I never wrote anything in python. I however read a lot of python scripts, mainly to fix bugs. I've read enough not to like it. Ruby on the other hand really looked as a good alternative when I would require a good OO scripting language. Python has - in the past - quite often said that they do not suffer from version incompatibilities, but to be honest, that is completely untrue: they suffer just as bad as any other (scripting) language. Most reasons for digging in python where just because of that.


    Enjoy, Have FUN! H.Merijn
      I find myself write less and less C as I can do almost anything in perl, and write it over ten times as fast in code that is easier to maintain. Some projects however still need perl: the code cannot be shared by law and perl has no good code-hiding feature.
      I think that we are on the same page here.
      I am not so sure about the lack of a "code-hiding" feature.

      I use the Active-State Compiler and this thing is pretty hard to "decode". Many years ago, a massive power failure took out my Power Supply and 3 HD's. That trashed my Perl source code for one project, but not my .exe. The .exe code still runs over 5 years with no reported defects - so I am happy about that! If somebody can help me recover the source code, I would appreciate it. But I am skeptical. It is not as easy as one might think.

      I love Perl. A wonderful language.

      A new school quarter started Monday and I'm going to be working with an assembly class. I like it. Perl can kick butt vs this stuff except in very high performance situations.

        I assume you are referring to PerlApp by AS. Use a C debugger, set a breakpoint in eval_pv() or something similar (I dont remember anymore) (finding eval_pv in the process will be the painful part), once the AS decompresser/obfuscator decrypts it into memory, it will be passed as 1 big string to the perl5**.dll which will be in a temp dir somewhere on disk.

        The other choice is to RE the PerlApp obfuscator algorithm Re: Security, is it to much to ask?. Its been published a couple times in history, for example A real challenge and Decompile PerlApp but AS changes it constantly for obvious reasons.
Re^2: I want you to convince me to learn Perl
by Jenda (Abbot) on Sep 25, 2013 at 15:04 UTC

    Well ... the speed ... it's both right and wrong. If you translate some code statement-for-statement from C to Perl, then Perl will lose hands down. For a large group of tasks a well written Perl script will beat anything you could write in C in reasonable time to pulp. The built-ins of Perl had been hand-optimized for years so if you can implement the task by a few calls to those built-ins, your program will finish sooner than if you attempt to reimplement them in your own code. In most cases it simply doesn't matter though.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1055663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found