The State of Scripting Languages
Esther Schindler writes to tell us that Lynn Greiner has another look at the state of the scripting universe as a follow on to the same topic three years ago. Greiner talks to major players from each of the main scripting languages (PHP, Perl, Tcl, Python, Ruby, and Javascript) to find out the current status and where they are headed in the future. "The biggest change since 2005 has been the growth of richer Web applications that perform more of their computations in the browser using JavaScript. The demand for these applications has forced developers to learn and use JavaScript much more than before. There's also been a lot of interest in Ruby, another dynamic language, spurred by the release and growth of Ruby on Rails. As a result of these changes, many developers are becoming more comfortable with dynamic languages."
Preemptive strike! You're a moron, and Java != Javascript!
schindler's list looks neat. I'll go read it sometime.
Show this to your friends and family that don't know what a real hacker is
Nah, I'm not really caught in a crossfire. I still prefer my trusty old Perl over these illegitimate kids and cousins - PHP, Ruby, Python, etc etc.
slashdot rocks
Can someone point me to a comparison matrix for PHP, Perl, Tcl, Python, Ruby, and Javascript detailing advantages and disadvantages, pros and cons for each? I hope someone will do precisely that and I will be glad.
Note: I only know PHP and Ruby.
Can anyone come up with a really good definition of a "scripting language"?
As far as I can tell, it's a vaguly amorphous definition based on some notion of interpretedness, but C interpreters exist, for instance, and TCC can be used to run C "scripts".
SJW n. One who posts facts.
First of all, it was an argument about scripting languages - the only difference is syntax. Yeah, yeah, one language make it easier for the programmer to manipulate text or to develop some functionality for a particular task. But this jazz of "the right tool for the right job" is non-sense. We're talking about programming languages: not screwdrivers, drills and hammers. It's all going to be a processor's instruction set one way or another.
Secondly, this article is in CIO. WTF does a CIO have to worry about languages for? That's the development manager's problem. The CIO's problem is the management of the organization and the technology big picture. How said technology is implemented isn't his problem: that's just minor details. I guess a micro manger would be concerned about a scripting language. If that's the case, he needs to quit and get a tech management job.
Just my two cents.
No-one said otherwise. The only thing in TFA I could see to which you might be erroneously referring is the Mozilla Rhino, a javascipt implementation for Java -- which is exactly what it is. Maybe someone's in a bit too much of a rush to use the word "moron"?
Caveat Utilitor
John Lam leads the IronRuby team at Microsoft.
Okay, John Lam is doing amazing work and IronRuby will likely be of some importance in the Ruby world one day, but "major player"? Microsoft's a major player generally, but in the Ruby world they are not. There are 1001 more notable people in the Ruby community who probably would have been up for this article - Chad Fowler, Dave Thomas, David Heinemeier Hansson, Matz himself.. They seem to have picked senior figures for all of the other languages (except PHP). CIO.com is not that poorly connected, surely?
Sorta. Was it Sinclair who announced how great their next computers would be, to the point that no one would buy their current offerings? I think Perl's going down that route, and the longer it takes, the fewer programmers there will be to try it when it comes available. I'm not a Perl hater by any means, but I jumped ship for Python a long time ago. I think most Perl hackers have done the same, or picked up Ruby. Perl 6 always sounded interesting, but not so much that I'd put up with Perl 5 until it was ready.
Dewey, what part of this looks like authorities should be involved?
This essentially summarizes the reasons I prefer to use Perl: the quality of the implementation, and the good libraries. However, there is a dark side that we Perl lovers don't talk about much, which is that although Perl has good quality and good libraries, many of the libraries are not of good quality. My purpose here isn't to name names and rip into individuals who have contributed open-source code to CPAN out of the goodness of their hearts, but honestly, some of the code on CPAN is of very low quality and/or very poorly maintained. Quite a few CPAN libraries are basically glue that interfaces to some C code, and when you look at some of that C code, it looks like examples of the worst coding practices of the 1980's, before the internet existed, and before it really registered on coders' consciousnesses that buffer overflows, etc., were not just bugs but security holes. I've had a couple of bad experiences where I hitched my wagon to a particular CPAN module, and later had serious problems because that module was not actively maintained. E.g., crippling bugs would go unfixed for a year at a time.
On the other hand, I'm not sure that any of the other scripting languages come off any better. What the article says really is true: the base implementations of the other scripting languages are really not anywhere near as solid as Perl's is -- probably partly because Perl is so much older than the others, and therefore more mature. But this may change a lot in the future. Perl 6 is eventually going to be ready for prime time, and there will be a certain amount of chaos and confusion and bugginess at that point, as everyone adapts to the new environment. Also, Perl's head-start in terms of maturity will start to mean less and less as time goes on and the other scripting languages start to get more mature.
Find free books.
They all still suck for about the same reasons they sucked three years ago.
The problems of Perl are well known, but it's probably the closest thing to "write once, run everywhere" that we have. Perl is essentially static at Perl 5. There's a Perl 6 effort, with a major language redesign, expected to ship shortly after Duke Nukem Forever.
PHP is gaining because it's a simple way to do dynamic web site back ends. It's not a great language, and limited to its niche, but useful there.
TCL was never a very good programming language, and it hasn't improved much.
Python is a nice language, but it still suffers from the limitations of the CPython implementation. It's slow, and integration with standard C modules is troublesome. Python has distro packaging problems - the Python maintainers don't coordinate with the maintainers of key modules, like the ones for talking to databases, and as a result Linux distros don't consistently ship with a CPython and a set of modules that play well together. That's why Python hasn't replaced Perl.
Javascript is a moderately painful language, yet we all have to use it. The object model is ill-designed; borrowing from Self was a mistake. Too much use is made of "eval", creating the "JSON" security hole. (Memo to language designers: don't combine the primitives for reading a string into an internal representation and for executing the internal representation. LISP has the "reader" and "eval"; Javascript has one function that does both.) Variable scope, given that the language has "var", is badly thought out. (Python is one of the few languages that does implicit declarations well. Perl had to retrofit "my", and Javascript had to retrofit "var", and in both cases, implicit declarations stayed, confusing the issue.) Because of this, Javascript has scaling problems. Attempts are made to paper this over with "toolkits", usually a bad sign.
I can't really say much about Ruby.
It's interesting that nobody uses Java applets much any more. It's worth understanding why that failed. But that's another subject.
I've had the same experience with CPAN: the code is often not very good, or the library doesn't really do what you expect it to do - a lot of contributions seem to be half-baked. In contrast, I have had a good experience with Tcl libraries. Perhaps one reason is that people put the half-baked stuff on the wiki (http://wiki.tcl.tk), where it is labeled as such, and don't present a full package until it is reasonably mature.
What did they use to code the Matrix?
Pffft, Perl is perfectly good for anything that needs string manipulation and such. You shouldn't ignore new languages that come along, but neither should you ignore old ones that get the job done perfectly well.
It is pitch black. You are likely to be eaten by a grue.
I hear a lot about Ruby performance - specifically, "Ruby/Rails can't scale". The odd thing is that this is in the context of a web app, where the overhead of the interpreter opcode execution is dwarfed by the cost of going over a socket to pull data across a LAN from a database. Scaling a web app isn't about the language; it's about architecture, judicious SQL optimizations, and caching.
Oh, and if you're using rcov to measure your Rails app's code coverage, try this patch to prevent rcov segfaults. It doesn't fix the root problem, but it's a start.
The Army reading list
I was surprised that Groovy didn't appear anywhere in the article. If there's a dynamic language poised to convert the enterprise crowd, its Groovy. Able to compile into Java bytecode, compile Java code, and directly exploit the huge base of Java, but without the cumbersome Java syntax. I wouldn't be surprised to see Python and Ruby supplanted by Groovy in a couple of years.
007: "Who are you?"
Pussy: "My name is Pussy Galore."
007: "I must be dreaming..."
Python has been my language for years. The pure beauty of the language together with the huge library did it for me. Plus, it's very easy to program python. Seriously. Just today, I've implemented an algorithm with a long, long loop and a lot of arithmetic operations. Python took 5:30 where Java took 10 secs. I'm serious, Python is SLOW, and last time I've checked, Ruby is even worse. (Interesting sidenote: C++ took 11 secs). I seriously love scipting languages, but the speed it horrifying. I'll stick to Java for a while.
You're recalling the Osborne Effect. I sure hope that doesn't befall Perl.
Pffft, Perl is perfectly good for anything that needs string manipulation and such.
Unfortunately for Perl, so is Python.
(Well, and Ruby. I'm partial to Ruby, but there's no XKCD for me to link to.)
Don't thank God, thank a doctor!
LOLCode | yes
Turing machine descriptions | yes
The Raven
Clearly you haven't heard of Jaxer.
Ruby's going through its own somewhat painful transition right now, what with 1.8.7 and 1.9. Hopefully that'll work itself out fairly soon, though.
I really like DHTML + JS + CSS for dynamic content. I downright love CSS; it takes time to learn, but it is just awsome. It's really just a problem of getting browser vendors to support a cross-platform standard for the DOM tree (I think we all know who I am talking about). Even with the mess that we have now, js libraries like prototype.js and mochikit have done a pretty good job of abstracting the browser quirks out of our code and given us a means to develop quality, working web applications quickly and easily.
Or, you could scrap all this progress and start over on a new standard. Good luck with that.
weirdest thing I ever saw: scientology advertising on slashdot.
Perhaps. I suspect CPAN ironcailly also suffers from it's own ubiquity and ease of access. Any highschool student can whip together a quick Perl module, and I suspect more than a few do. The result is that poorly written or only half-baked projects end up there.
By contrast, the only people writing Tcl modules are those serious about using the language, and that immediately introduces a selection bias.
Several years ago I wrote a javascript module for Asterisk open source PBX
More recently I added it for my own project FreeSWITCH ( http://www.freeswitch.org/ )
We actually also support LUA, Python, Perl, JAVA and MONO as ways to script telephony apps.
It's quickly becoming a great new way to prototype and deploy audio driven apps for your phone system.
PHP and Perl don't really deserve to be labeled "scripting languages" in my head either any more. PHP has had growing object oriented capabilities for ages - PHP 5.3a1 even got lambdas w/ closures. PHP is a fairly great language; it got a bad rap due to the way it enabled horrible security practices so well in the PHP3 days. I think I prefer Python/Django due to the more expressive syntax and superior templating, but PHP is good and getting better. Is it dynamically interpreted? Sure, but you can use bytecode caching to save compiled copies. Likewise, Perl may be suitable for use as a scripting language, but it has obviously become a lot more.
I think it's the other way around. It has a lot of bindings, programs are shipped as source, and it has many conveniences, which makes it a scripting language - which incidentally is powerful enough to do application development.
There are few languages in modern use that are not object-oriented (I can only think of C and Fortran in their respective niches), so it's not a sign of not being a scripting language.
Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
Dynamic Languages Jobs Barometer
007: "Who are you?"
Pussy: "My name is Pussy Galore."
007: "I must be dreaming..."
I'm not sure what you're sick of with C++, but I've been writing objC lately for the iphone, and I'm definitely enjoying it a lot more than I ever enjoyed c++. (Although that may be just because I like Apple's nextstep object hierarchy more that I ever liked the c++ libs)
Of course there's a lot of crap on CPAN. But there's also a lot of really good stuff, and there are tools to help you find the best of the good stuff. Besides which, having someone else's complete and utter crap to work with can still give you a head start compared to doing everything from scratch. Not to mention, in one-off projects you can sometimes just use the utter crap, get the job done, and not have to tell anyone.
I think the W3C should evolve the scripting area to recognize and have UI/App components in the language. Mesh CSS/DOM/JavaScript/Ajax along with accessibility and usability as a new toolkit and standard. That's why Dojo and the likes are so popular. If the W3C evolved the scripting/development toolkit for that, it would make sense to me.
Perl is a language for getting work done in. Plain and simple. It's not as cool and trendy as Python or Ruby, but it is more mature and IMHO more productive.
The "write only" complaint of Perl is easily addressed by adhering to some basic coding standards and (gasp!) commenting your code. A little self-discipline goes a long way.
I work with 4 other Perl programmers. Because we all follow a simple set of coding standards and design patterns, no one has any problems understanding anyone else's code.
Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
A good browseable documentation. CHM rules.
P.S. And, btw, ask the .Net crowd about scripting languages. M$ already brainwashed them. Will you see, C# is not scripting, CLR is not interpreter. Scripts sucks because they sucks and C# is better. Scripting languages are dead. End of topic. Move on.
Really? Is that what the culture's like? I am not really a part of that so I don't know... My impression was that .NET had a lot to offer for users of Unix scripting languages - really good interaction with other languages and applications' scripting interfaces, good bindings to system facilities, and the ability to take advantage of the CLR for just-in-time compilation...
Bow-ties are cool.
I thought Perl had full Unicode support... is there something in particular in it's implementation that you feel is missing (I've never had to work with Unicode, so I honestly don't know)?
You are quite right. But it still applies to evil creatures like PHP.
Damn straight...
I have serious doubts about the usefulness of this kind of language feature, compared to its painful consequences...
Bow-ties are cool.
Java?
I beg to differ.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
Can Perl 6 access Perl 5 modules while in Perl 6 mode? If not, CPAN for Perl 6 is behind by several years.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
I think this makes a certain amount of sense when 99% of what you're doing is dealing with text (command-line arguments, form input on the web, database queries, whatever) - it makes it very convenient to deal with text in terms of the usual meaning applied to that text, and apply your results back to a textual context without a separate operation.
I don't particularly like this in general - but I would say that I'm not prepared to write it off entirely...
Bow-ties are cool.
It's amazing how much people forget. 'dynamic languages are gaining acceptance' - some of the first programming languages were dynamic. Almost all of the 'innovations' we have seen in 'scripting' languages in the past ... 20 years or so have been done before, in LISP, normally in the 70s.
*sigh*
If you your string concatenation operator is distinct from your addition operator, it's simple to tell whether you are dealing with a string or a number from context. Plus it lets you do neat stuff like:
my $filename = 'file0000';
$filename++; # = file0001
Why write more code than you have to?
And if you have more than 10000 files? Not to worry, your filename will advance from "file9999" to "filf0000" - the counter system is naturally extensible... ...There's something to be said for telling the language exactly what you want it to do, rather than trusting that the default behavior, whatever it may be, will do what you want... especially when you're dealing with a funky concept like "incrementing text"...
Bow-ties are cool.
Last I checked, it is none of those *and* it used to be the powerhouse behind killer Web 3.0 sites like MySpace and FuckedCompany*.
*IIRC.
but I jumped ship for Python a long time ago. I think most Perl hackers have done the same, or picked up Ruby.
I really don't get it. I know Perl inside and outside. Last year I learned Python, and currently I'm reading a book on Ruby. But that doesn't make me forget Perl, so why not use it when it fits the problem being solved. Additional languages are new tools to add to your toolbox, but they don't remove your old tools. Why stick with one language when you can use all of them as you see fit?
An often overlooked scripting language is Mumps (Massachusetts General Hospital Utility Multi-Programming System), developed in the late 1960's.
Mumps (also referred to as M) supports a multidimensional and hierarchical database facility implemented as string subscripted array references. It was widely used in clinical computing and remains to this day the basis of the U.S. Veterans Administration's computerized medical record system, the largest of its kind in the world.
Its main features are: (1) its tree-structured (multi-dimensional) database; and (2) its flexible string handling facilities which now including PCRE functions.
There are both compiler and interpreter versions available as open source/GPL packages. It supports many text processing functions, system shell integration, as well relational database access. There is also a compatible C++ library to integrate the tree structured data base access into C++ programs. The Mumps/II native hierarchical array database may range in size up to 256 terabytes.
The package is available from:
http://www.cs.uni.edu/~okane
(see download link).
Kevin O'Kane http://www.cs.uni.edu/~okane/
Only Perl can read perl. You can forget about a fancy IDE with intellisense when you use perl.
PHP support means generating a wordlist that would wrap from coast to coast.
Ruby? Dunno.. but like Perl and PHP since it is dynamically typed it is harder to write an IDE for it. Haven't seen what Microsoft has done for it yet.
Javascript? Really depends on how well you can manage keeping your Javascript code in sync with your server code.
Java?
Going for a +5 funny IC.
Why are single-byte chars even possible in this day and age in the context of a string?
Because the old grampa C coders really, really like hand-optimized pointer arithmetic*. That and 8 bits is enough for any language blessed by the queen.
*course, if you use wchar you could do the same pointer arithmetic as before.
I did so because Python is a complete superset of Perl for me. Anything I'd previously wanted to do in Perl, I can more easily do in Python. I guess that I can't think of a problem where Perl would be the best solution anymore.
Dewey, what part of this looks like authorities should be involved?
CPAN is the best part and the worst part of Perl.
Ever tried to write a meta package in whatever build system you use (FreeBSD Ports /gentoo whatever/ RPM)? Especially when the ports tree doesn't have all the CPAN modules?
Talk about a mess! That said, you only really have to do it once and then maintain your meta package.
Ruby's going through its own somewhat painful transition right now, what with 1.8.7 and 1.9. Hopefully that'll work itself out fairly soon, though.
The difference is, 1.8.6 doesn't suck. Most of the difference is that 1.8.6 is slower, due to being on a slower VM. Most of what breaks (now, anyway) in the transition to 1.9 are various native extensions.
However, Perl5 does suck, compared to Ruby or Python. Perl6 looks very, very good -- but is nowhere near ready.
I could reasonably expect to pick up Ruby 1.8.6 (or 1.8.7), and have most of my existing code and coding style still work in 1.9. Or I could pick up 1.9, and backport some features to 1.8.6 (which is what 1.8.7 is, mostly).
I don't think I could reasonably expect to pick up Perl5, and know anything at all about Perl6. The best I could hope for is that most of my old code would still work in Ponie, which is Perl5 on the Perl6 engine -- implying that yes, they are completely different languages.
Don't thank God, thank a doctor!
Can Perl 6 access Perl 5 modules while in Perl 6 mode?
Yes, Perl 6 will be able to use Perl 5 packages.
Lua's said to be the number 1 scripting language for making games. Surely it deserves a mention.
Poor Lua never gets the respect it deserves.
Ruby example:
/\w+ \w+ \w+/
>> puts 'yep' if 'I like cats' =~
yep
or:
>> "I like cats".match(/\w+ \w+ (\w+)$/).captures
=> ["cats"]
You can create a union of two regexp:
>> Regexp.union(/I like \w+/,/sandwhiches$/)
=> -mix:I like w-mix:sandwhiches
Also they are Perl compatible.
So, no interview with Mike Cowlishaw, the developer of Rexx? Ignoring Rexx, Object Rexx and NetRexx?
I thought this was about scripting languages.
And NASA alone having MILLIONS of lines of Rexx code.
I've coded Rexx on IBM CP/CMS, Amiga, and Linux.
And the Amiga version is better than what is available for Linux.
Rexx; everything is a string, and math is decimal based, with 15 digits of precision.
It is possible to ship a Python program in its "compiled" form (i.e. .pyc files), many Python-based BitTorrent clients do that.
The distinction between scripting language and programming language these days are blurring. Just like compiled vs. interpreted languages.
This part from the old TFA cought my eye:
When reading this, I immediately thought of ARexx (and now also show my fondness of the Amiga and somewhat show my age, now git of my lawn!). The use of scripting languages as glue between different programs is somewhat forgotten these days I think. Also forgotten is the easy witch with you could embed ARexx, and how extremely easy it was to interface with programs using ARexx.
I think these aspects could be better developed.
/ The Arrow
"How lovely you are. So lovely in my straightjacket..." - Nny
It's a game sailors play.
You need a few drinking buddies, a long banquet table with a long, heavy tablecloth, and one prostitute.
The idea is to sit at the table while the hooker(who is under the table) will chose one of the men at random and begin sucking his dick.
The object of the game is to receive fellatio and come without making it known to the other guys. For example, if the hooker chooses you and you squirm or grunt whilst having your dick sucked, and one of the guys calls you on it, then you lose and you have to buy the next round of beers before the hooker chooses another man at random.
It's a game GNU/Linux users play.
You need a few drinking buddies, a long banquet table with a long, heavy tablecloth, and one Vista lappy.
The idea is to sit at the table while the Windows box with Crysis (which is under the table) is passed to one of the men at random and they begin playing.
The object of the game is to play the game and win without making it known to the other guys. For example, if the game chooses you and you squirm or grunt whilst playing Crysis and one of the guys calls you on it, then you lose and you have to buy the next round of beers before the game chooses another man at random.
Not a single one does Unicode properly.
Perl handles Unicode just fine (since 5.6, that is).
Pffft, Perl is perfectly good for anything that needs string manipulation and such.
Unfortunately for Perl, so is Python.
I think string manipulation is an area where I've found that Python just doesn't compare to perl or ruby. It is so much more annoying to write this in python: /(.*)@/) { print $1; }
if ($str =~
And no, I'm not afraid to write three more lines of code, but I hate moving logic away from the place where it's applied, just to support the limitations of a language.
A cat can't teach a dog to bark.
Why was the above marked "offtopic", or is Perl somehow not considered a scripting language, and is Perl-6 somehow not giving similar-flavor 'warm-fuzzies' as Vista?
Perl6 != Perl, Larry admits this -- he just took the perl name for recognition, but it's a new language.
The question is -- will the community of perl5 users just let perl die?
At least with Perl, there is an option. With XP vs. Vista, ... well, there *should* be an option, but...
Does being object-oriented help? I look at the quality of the code written in C and I look at the quality of code the comes from pseudo OO languages (C++, Python, C#) and it is not up to the same standard. It seems to me that OOD hasn't help up to the ease of use that its proponents have been pushing for the last few decades since it seems to lure developers into a false sense of architecture scale.
According to the coverity report http://scan.coverity.com/rung2.html Perl does not have the lowest defect rate.
The difference is, it will be much easier to write a python in perl 6 then a perl 6 in python.
Perl 5 is a glue, perl 6 will be a super glue. Perl 6 can glue together much wider range of codes, which of course, including perl 5.
I write perl and bash more often than not.
I'm learning Ruby, even though it's Verboten for use at my place of employment. (It's not guaranteed to be installed on any particular server, and it's probably intentionally removed if it's part of the OS install.)
If I need QnD string manipulation, I use perl. I haven't touched Python since about 1999.
When politicians are involved, everyone loses.
But even perl chokes badly on "invalid" chars, and there's no way that I could find to just replace them with question marks or just pass them around unchanged. I work with terabytes of text and this text comes from the web, blogs and other sources. It is pretty much guaranteed to have broken chars in it, and I don't want to throw away a line of text just because one character is not an "approved" Unicode code point.
Python is pretty busted - I gave up on it after trying to write a scraper in it (using BeautifulSoup). I'd need to fix _standard libraries_ to make it not crash every now and then, and I'm spoiled - I expect the libraries that come in the RPM to just work. Ruby doesn't even know what this Unicode thing is.
I love the fact that Perl fans always mention regexes but never mention the fact that in a subroutine you have to unpack your own parameters with the really so blindingly obvious '@_' .
Now I don't know about you but most of the things I write in Python are pretty damn big and regexes are a very small part compared to say *all the functions*
So can I live with slightly more complex regex *syntax* in return for the rest of the language having a syntax I don't need to think about?
(and yes there are perl dudes who know this stuff inside out - but *why* would a newcomer scale these ridiculous barriers to entry?)
Facts, for one. No one who's tried to reproduce TIOBE's data has succeeded. Unreproducible statistics are suspect.
how to invest, a novice's guide
Well, I don't have much experience with CPAN. But my experience with python is that I find out what library I need online, and then install it with easy_install.
import re
reg = re.compile('.*@')
m = reg.search(string)
print( m.group() )
"Why stick with one language when you can use all of them as you see fit?"
Because there are only so many API's that fit into my tiny head.
Python's current wave of popularity will make it handy to know when you want to use someone else's code, but everytime I encounter someone else's Python, it only runs on version X.
It's a pain to be a Python admin, its just simplicity to do so for Perl 5.
All this talk of Perl 5 and 6 - the lifespan of a Perl 5 script is probably amongst the best of all languages in terms of major distro's providing an interpreter that still runs the old code base.
Python is going through evolution, a little too much for my liking to be effective. That and many Python programmer's still can't decide how to treat a list of 1 element.
If you already think in Perl, Python is wasted effort.
I guess that I can't think of a problem where Perl would be the best solution anymore.
Any task that involves iterating over a bunch of lines, applying pattern matching to them. Perl is well optimized for this, and handles it substantially better than python. Although it's worth considering whether either sed or awk might be better -- they often are.
Even then, "string =~ s/foo/bar/" isn't inherently better than "string = re.replace('foo', 'bar', string)". It's slightly less typing, but since Python's using Perl's RE engine, there's no difference in actual functionality.
Dewey, what part of this looks like authorities should be involved?
... and that since it's not rigourous enough we should be using other languages like Scala. If Java's type system IS enough (but incomplete) then the argument goes why should dynamically typed languages be singled out for not being robust enough on bigger code bases? I'm paraphrasing from the Static Typing's Paper Tigers section of Steve Yegge's Rhino's and Tigers blog post though.
I doubt that dynamic languages slowness would be solved (today without new research) if they switched to static typing though... Surely dynamic languages could target VMs like the JVM or CLR and that may ultimately lead them to running just as fast as Java or C#? If that were the case the speed problem would not be down to their dynamic nature but perhaps something like the lack of extensive JITing...
While Slashdot might not be the place that company movers and shakers read, it's interesting to follow your replies and justifications for the article here (and of course it has encouraged me to read the article itself).
Given that your comment predates mine, I'm pretty much assuming that the progression was like this:
Guy likes Lisp, because it's elegant.
Guy finds that Perl gets stuff done, but it's a lot uglier.
Guy finds that Python gets stuff done faster and more easily than Perl, and isn't as ugly. Nowhere near as beautiful as Lisp, though.
Don't thank God, thank a doctor!
Neither Python nor Ruby have a code repository with the depth and breadth of CPAN. Rubygems has promise, but CPAN has at least a 10 year head start on it.
Depth and breadth means nothing at all when I can find exactly what I need in Rubygems.
It's a bit like Google. What do I care what the other few hundred million (or billion) results are? I'm probably not going to read past the first page.
...more mature and IMHO more productive.
I would agree with you, but only because of CPAN. And given the above...
No, I don't think Perl is "write-only", and I know it isn't horrible. I know it's possible to write ugly Ruby code.
I do, however, find that on the occasion I have to do more than simply glue components together -- that is, when I have to actually write something new -- I can do so much more easily in Ruby than in Perl.
Don't thank God, thank a doctor!
That's because you don't have to use @_ or shift. Perl can support named parameters, optional parameters,
Really? I've never seen it, not directly. All I ever see is:
my ($arg1, $arg2, $arg3) = @_;
Or:
my $params = shift; ... }
if ($params->{whatever}) {
Does it have more than this?
I do know that with Ruby, I can specify a "splat" argument, or I can use the positional arguments directly. And with Javascript, I can either use positional arguments, or the "arguments" array, or both. But Perl only ever seemed to support @_.
I'm sure the CPAN has modules for all this.
Ah. That explains it.
It's interesting how that works -- when a language like Perl stagnates, people extend it with modules. Not necessarily bad, just strange.
Don't thank God, thank a doctor!
>However, Perl5 does suck, compared to Ruby or Python. Perl6 looks very, very good -- but is nowhere near ready.
Frankly, I think that Perl6 only looks good to Perl lovers, myself I think that it still looks like noise different noise from Perl5 but still hard to read and to maintain.
For beginners, there's Python, for advanced users who know already know shell or Perl5 and are not satisfied with it there's Ruby..
myself I think that it still looks like noise different noise from Perl5 but still hard to read and to maintain.
One of the features of Perl6 that I really like is custom syntax. That helps a lot.
I like a lot of Ruby syntax, some of it Perl-inspired -- the optional brackets are beautiful. I like Python's indentation, and if I could, I'd probably be using Lazibi in Ruby. I like Javascript's object notation, and its treating of hashes as objects.
A lot of these, though, are mostly cosmetic. Certainly it's possible to abuse things, but by making the syntax separate, it means we can stop arguing about what syntax makes a good language, and start focusing on other features.
For beginners, there's Python,
I don't know, I've yet to see an environment beat Try Ruby for sheer beginner accessibility.
Don't thank God, thank a doctor!
Ruby's nice, but it's slow compared to Python. If you're doing something where that doesn't matter, then Ruby's a nice choice.
Also, Ruby's libraries seem to be more specialized towards web development than Python's. This may well make Ruby a better choice for that area. But they are (or were) much weaker in more general areas. So again, it depends on what you're doing.
I think we've pushed this "anyone can grow up to be president" thing too far.
I'm not sure "stagnates" is fair; one of the design goals of Perl 5 was to enable language experimentation and extension in modules. 14 years (and some 14,000 distributions on the CPAN) later, there are some successes.
how to invest, a novice's guide
LUA. Just check out how many major apps and games have selected Lua as their scripting language due to lightweight runtime, ease of integration and relative speed.
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
"""I work with 4 other Perl programmers. Because we all follow a simple set of coding standards and design patterns, no one has any problems understanding anyone else's code."""
I'm a Python user myself, just because the language happens to fit better with my temperament and preconceptions, but I used Perl fairly extensively in the early days of the wild, wild web, and I do get a little tired of the users of one language knocking other languages unnecessarily.
In Iceland this week, a Python User Group member who has a large web site written in Perl asked me "Why should I rewrite my web site in Python?". I couldn't think of a single reason, as long as the site is doing what it needs to. Perl is a workhorse language, and will likely continue to be so.
I *do* think Python has advantages as a first programming language but, as Tassach observes, an experienced programmer will get the best out of whatever language they use by adopting disciplines that make up for its shortcomings. We sometimes jokingly refer to Perl as a "write-only" language, but that could also be construed as a compliment about its terseness. A good Perl programmer with a familiar toolkit at their fingertips can cut code at high speed, and the problem of understanding six months later what it does is eased by simple documentary comments.
Ruby's nice, but it's slow compared to Python. If you're doing something where that doesn't matter, then Ruby's a nice choice.
If I'm doing something where that does matter, I'll write C extensions to do the heavy lifting, or I'll write the whole thing in C/C++.
And for that matter, all my personal projects target the experimental Ruby 1.9, which beats Python in a few benchmarks.
Also, Ruby's libraries seem to be more specialized towards web development than Python's.
Maybe. I haven't tried to do much else with it for awhile -- though I frequently see and hear of other projects.
Then again, the closest thing Python has to a package management system... EasyInstall sucks. So how am I going to get ahold of those other Python libraries in the first place?
And the main reason I use Ruby is, if I end up having to write these libraries myself, it won't be too painful. I think it wouldn't be nearly as much fun to try that in Python.
Don't thank God, thank a doctor!
FWIW, I've had no trouble with getting and installing Python libraries. Most of the ones that I need come included with Python.
OTOH, if I *really* need speed, then I agree with you, a native compiled language is the way to go. Because of library availability that usually means C or C++, though I'd rather use a language with decent syntax and garbage collection, like D. No libraries for that, though.
Python is my choice for the intermediate position. It's got much of the desirable language feature of an interpreted language, and it's only around 5-10 times as slow as C. (Just how much depends on how much your code is using native libraries.)
I think we've pushed this "anyone can grow up to be president" thing too far.
Well, since you didn't put static typing on the list, what you want is called Common Lisp, and it's been out in the wild for quite a while.
If that was just an accidential omission, I suggest that you have a look at Fortress. On the other hand, with the introduction of concepts, constexpr, basic type inference, lambdas, and some other syntactic and semantic improvements, C++0x might also be good enough.
Javascript is a moderately painful language, yet we all have to use it. The object model is ill-designed; borrowing from Self was a mistake.
Why? After experimenting and then writing real applications in it, I really quite like the object model, and find the language most expressive and flexible thing I've really written anything in (C, C++, Java, Perl, PHP), so much so that I'm fearing the introduction of classes, even though it has some good reasons, is going to turn the language into a middle-morass ghetto like Java.
Too much use is made of "eval"
An over-used feature in a language is one of the easiest problems to address.
Because of this, Javascript has scaling problems.
Scoping and namespace collision issues are real, but there are pretty ready techniques for dealing with them. Scaling really only becomes a problem when you need to bring together two codebases written by programmers who didn't use those techniques.
There are definitely other security and other implementation issues, but increasingly, I'm finding that unless I need rich media features for which something else is more appropriate, I actually *prefer* working in Javascript.
Tweet, tweet.
Python is my choice for the intermediate position.
I guess that's the part I don't get. What, exactly, is the intermediate position? What's a use case where Python's speed advantage actually matters, yet the speed advantage of something faster (like C) doesn't?
Don't thank God, thank a doctor!
Absolutely, use the best tool for the job. I used Perl for about 4-5 years. Did a lot of text processing, network programming, and system administration tasks with it. Some were throw away scripts, others stuck around for a while.
Then I picked up Python. Over the next year a funny thing happened. I began using Perl less and less. Python was just so easy and clean and structured. I didn't need cpan because the standard library did 98% of the job for me. As I learned more Python, it became the best tool for the job. Even quick throw away jobs. I stopped thinking about cryptic undeclared variables and tripping over $ @ % distinctions. Python just worked. Whenever a script morphed into something beyond it's original purpose, the transition was effortless. It's been about 4 years and I haven't looked back.
I didn't give up Perl because my toolbox was full. I gave it up because it's no longer the best tool for any job. YMMV.
Democracy is two wolves and a sheep voting on lunch.