6 ms·
But is that really unique to Perl these days? It may have been true in the mid-1990s, but things have changed since then. Python and Ruby both have a much clea
by Pacabel 13y ago
But is that really unique to Perl these days? It may have been true in the mid-1990s, but things have changed since then.
Python and Ruby both have a much cleaner syntax, yet still offer very comparable functionality, excellent portability, ample standard and third-party libraries, excellent documentation, supportive communities, great regex support, and basically everything else that Perl offers.
Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects, Perl seems like a less and less enticing option each day.
- _delirium 13y agoIt could be familiarity, but for small- to medium-scale "scripts", I still find Perl to be the best alternative to bash+sed+awk+grep thrown in, when I want to go to something more conventionally programming-ish. Basically its original use-case, before Modern Perl. You can use Python for that, but the jump from Unix shell to Python feels bigger; everything is more verbose and less awk-y in Python. Which can be good for maintainability of bigger scripts, but feels heavyweight for some stuff.
- wting 13y agoAre you aware of sh? http://amoffat.github.io/sh/ http://amoffat.github.io/sh/
- codygman 13y agoAnd the Haskell equivalent for a performance and type safety boost: https://github.com/yesodweb/Shelly.hs https://github.com/yesodweb/Shelly.hs
- kamaal 13y agoIts not about having function to call shell commands. That way I might as well use C or C++ or Java. Its about how such a feature interplays with rest of the language. Frankly speaking in Python it looks like added after a lot after thought and a lot of reluctance. Same with regular expressions.
- _delirium 13y agoYeah, it's not just about shelling out, but about being able to write Perl that works sort of like an awk script, just with more of a real language attached to it. Functions that implicitly work on the current line, lightweight regex syntax, the <FILE> magic, bash-style file tests (-e/-r/-d/-f), etc.
- PuercoPop 13y agoPerl has reader macros and a meta-object protocol upon the object system is built with. Ruby and Python don't have either AFAIK. That is an example of what the OP is saying with Perl is an extensible language.
- banachtarski 13y agoYou should learn Ruby.
- systems 13y agoit seems that Ruby doesnt have a MOP http://codefol.io/posts/Does-Ruby-Have-a-Metaobject-Protocol http://codefol.io/posts/Does-Ruby-Have-a-Metaobject-Protocol
- einhverfr 13y ago> Perl has reader macros and a meta-object protocol upon the object system is built with. More specifically, Perl has advanced features with which meta-object protocols can be built with. See Class::MOP on which Moose is built. > That is an example of what the OP is saying with Perl is an extensible language. I think the difficulty with Ruby and Python is that both are fully object-oriented, which means it is difficult to create something that is truly orthogonal to the object model.
- marcosdumay 13y agoPython is not fully object-oriented.
- rat87 13y agoIn what way?
- systems 13y agohow does Perl have reader macros, can you please point to a link if possible? i couldnt find this one simply searching online
- einhverfr 13y ago> Python and Ruby both have a much cleaner syntax Cleaner syntax than the declarative class mentioned in the article? > Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects, Perl seems like a less and less enticing option each day. To my mind though the benefit is in mutability of the language. Yes, there are other languages in this category (rebol, red, lisp), Perl is somewhere between these and Python and Ruby. If I were to order them from most mutable to least, I would go lisp, rebol, red, perl, (python and ruby). This is a powerful thing and of course with great power comes the possibility of misuse.
- kamaal 13y ago>>But is that really unique to Perl these days? Yes. Scripting powers of Perl are unmatched. >>It may have been true in the mid-1990s, but things have changed since then. Hardly anything has changed. No language has taken scripting that seriously. You are likely confused between dynamic languages and scripting langauges. There is a big difference. If you haven't noticed, well then that's the whole point behind Perl. You really need to use it to see what it is. >>Python and Ruby both have a much cleaner syntax Its not about having a cleaner syntax. Making it easy to learn, only means the complexity is left to the programmer to handle now. Either way some one needs to handle the complexity, Its either the programmer or the language. If you make the language simpler, the complexity burden shifts to the programmer. >>yet still offer very comparable functionality, excellent portability, ample standard and third-party libraries, excellent documentation, supportive communities, great regex support, and basically everything else that Perl offers. Python takes great care to purposefully avoid offering every thing that Perl offers. >>Since everything positive about Perl is also offered by alternative languages today, and those alternatives are themselves much better than Perl in some respects You will have to substantiate that point with some evidence. >>Perl seems like a less and less enticing option each day. That is being told since what? 1988?
- danellis 13y ago> Yes. Scripting powers of Perl are unmatched. Can you offer any examples of how that is true?
- kamaal 13y agoThere is monumental material on this in sites like Perlmonks. I started writing a detailed reply, but half way down I realized it might become a booklet project[Which is a very good project idea by the way] I also realized I may not be able to justice to 3 decades of Perl history in one HN comment. So the best I can do is point you out to two links. http://hop.perl.plover.com/ http://hop.perl.plover.com/ and http://onyxneon.com/books/modern_perl/ http://onyxneon.com/books/modern_perl/
- skrebbel 13y ago
- davvid 13y agobasically everything else that Perl offers ...except for performance. The GIL is Python's achilles heel; if you throw threads at the problem Python gets slower while Perl actually uses all your cores. C.f. http://yaketyhack.blogspot.com/2010/07/threading-perl-vs-python.html http://yaketyhack.blogspot.com/2010/07/threading-perl-vs-pyt... BTW, I love Python.
- kbenson 13y agoPfft, that guy obviously doesn't know how to use code blocks. :D
- otterley 13y agoAlso, a good debugger. Perl's debugger is still far, far better than Python's or Ruby's.
- collyw 13y agoIs it? I generally use a graphical debugger in Eclipse. I have used Python and Perl, and can't see too much difference between them. Whats better about the Perl one?
- mst 13y agoEvery time I try and write python or ruby I get an hour or so in and find that I'm writing 5x as much code as I would in Moo/Moose just to express the object design I want. I've been known to say "perl5 is a lot like ruby except with usable OO" and it's very much a "ha ha only serious" sort of comment.