4 ms·
I think it's better to flip the question around: I make my living writing single-page web apps in JavaScript. These days, everything I do, even on the server,
by maxharris 12y ago
I think it's better to flip the question around:
I make my living writing single-page web apps in JavaScript. These days, everything I do, even on the server, is in JavaScript.
What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)? If it doesn't, that right there is your answer.
- kiyoto 12y agoYou clearly work in the web industry =) perl does one thing hundred times better than (server-side) JavaScript: when you need to get data out of a server that you have no sudo privilege because your boss asked you to get stats on your trades ASAP. This happens shockingly frequently in finance, and perl (and actually, awk) was the only scripting language that I could safely assume was installed.
- erikb 12y agoBeing sure that this one tool is available all the time is actually a key argument I have to say. One of the reasons I started to learn vim.
- erikb 12y agoI have to agree. There's nothing you need Perl for, and nothing it specifically offers. Like if you want to do something in Wordpress you can only use PHP, no choice. If you want to code a Linux driver you have to use C. If you want nice features like awesome readability you choose Python. If you want awesome power you use some kind of Lisp or Haskell. There is not a single (well known) reason for using Perl. Even if it's 10% better and faster than any other language without a unique selling point the cost of switching is just too high in most cases.
- jonathankoren 12y agoNo language handles regular expressions as easily as Perl. Perl's power has always been in its power to do text processing. That said, it's objects and pointers are a joke. At least Perl 5's are. As for Perl 6, I don't know. It couldn't hold my attention for 15 years.
- tomjen3 12y agoHow does Perls regex stand up against Python? I mean once Perl was the pearl of regex/text processing (The Common Lisp package that everybody uses for regexis pcre, Perl Compatible Regular Expressions) but that was a long time ago.
- raiph 12y ago= About Python regexes = Aiui "The Future of Python Regexes" SO answer at http://stackoverflow.com/a/7066413/1077672 http://stackoverflow.com/a/7066413/1077672 written by regex (and Perl) expert Tom Christiansen (and last updated by him in 2012) is still good info. In brief, https://pypi.python.org/pypi/regex https://pypi.python.org/pypi/regex appears to be the path forward for Python. This engine is much closer to the power and Unicode compatibility of Perl 5's default regex engine. = About Perl 5 regexes = Aiui the default Perl 5 regex engine is significantly faster than the 're' regex feature included with Python 2. I don't know how it compares to the new 'regex' module. Regexes in Perl have the advantage/disadvantage that they are syntactically integrated in to the language (a disadvantage if you don't like it being integrated). Since Perl 5.10, a different regex engine can be plugged in and used without requiring any change in code that uses regexes (unless an engine uses a different syntax of course). (But it takes a lot of effort to package a regex engine up for use with Perl 5.) A given regex engine can be extended using the overload module. Extending is relatively easy. = About Perl 6 regexes = A whole new ball game, two decades ahead of Perl 5 regexes. http://en.wikipedia.org/wiki/Perl_6_rules http://en.wikipedia.org/wiki/Perl_6_rules http://doc.perl6.org/language/grammars http://doc.perl6.org/language/grammars https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Grammar.pm https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Gra... Generally matches Perl 5 regexes feature-for-feature but with a much cleaner syntax. More importantly, unifies regexes and grammars. Currently way slower than Python or Perl 5 regexes. Supposedly will eventually (5 years? 10?) incorporate all the key optimizations in the Perl 5 engine and become faster than Perl 5 regexes.
- cutler 12y agoCase in point, with the countdown to Perl 6 now on the cause seems hopeless: Perl 5.20 / 19Mb Apache log file / time: 1 sec perl -wnl -E 'say $1 if /\b(\w{5})\b/' logs.txt Perl 6 (MoarVM 2015.02) / 19Mb Apache log file / time: 88 secs perl6 -n -e 'say $0 if m/(<<\w5>>)/' logs.txt Given that efficient text & regex parsing is Perl's forte I don't see Perl 6 satisfying the basic requirements of Perl 5 hackers.
- _pmf_ 12y ago> What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)? If it doesn't, that right there is your answer. Well, for a start, it's relevant for more than 3 months. Asking for doing something 100 times better is quite a mouthful, coming from a JS developer.
- __david__ 12y ago> What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)? A concise POSIX interface. Conciseness in general, really. How many node one-liners do you see?
- singingfish 12y agoThe fact that I can be contemplating career suicide after reading the source to CGI.pm one minute (once amazingly useful and best of breed, now a crufty monster) and the next doing insanely useful things with metaprogramming, declarative interfaces and terse, easy to read code :)