The anti-JavaScript

The problems with JavaScript come from premature standardization. The language’s author Brendan Eich said

I had to be done in ten days or something worse than JS would have happened.

For a programming language designed in 10 days, he did an amazing job. Maybe he did too good a job: his first draft was good enough to use, and so he never got a chance to fix the language’s flaws.

The opposite of JavaScript may be Perl 6. The language has been in the works for 12 years and is still in development, though there are compilers you can use today. An awful lot of thought has gone into the language’s design. Importantly, some early design decisions were overturned after the community had time to think, a luxury JavaScript never had.

Perl 6 has gotten a lot of ridicule for being so slow to come out, but it may have the last laugh. Someone learning Perl 6 in the future will not care how long the language was in development, but they will appreciate that the language was very thoughtfully designed.

* * *

Another contrast between JavaScript and Perl 6 is their names. Netscape gave JavaScript a deliberately misleading name to imply a connection to the Java language. The Perl 6 name honestly positions the new language as a successor to Perl 5.

Perl 6 really is a new language, compatible in spirit with earlier versions of Perl though not always in syntax. Damian Conway has suggested that perhaps Perl 6 should have been developed under a completely different name. Then after it was completed, the developers could announce, “Oh, and by the way, this language is the upgrade path for Perl.”

If you think of Perl 6 as a new language, your expectations are quite different than if you think of it as an upgrade. If it’s a new language, it doesn’t matter so much how long it was in development. Perl programmers would be pleased with how similar the new language is to their familiar one, rather than upset about the differences. And people would evaluate the new language on its merits rather than being prejudiced by previous experience with Perl.

More programming posts

6 thoughts on “The anti-JavaScript

  1. I just wish Perl6 was a tiny bit more *there* already. Yes, yes I can use it and there’s on-line documentation, but if I can’t buy pretty O’Reilly books solely about the new language (not Perl5 with Perl6 notes) it feels a bit half-baked still. For example see this : http://www.learningperl6.com “It’s our hope that someday they’ll settle on the final language, allowing us time to make the book.”

    Is that out of date now? I saw a Damian Conway talk where he said Perl6 is available, usable, effective etc. If so why are the books so laggardly?

  2. Christian Sciberras

    I’m a bit confused.

    You’re telling us we should be coding website frontends in Perl??

  3. I’m not saying anyone should or should not use Perl. But I do think that Perl 6 is interesting. A lot of thought has gone into preserving the things people like about Perl while making the language more powerful and more consistent.

    I personally don’t use Perl. I prefer the philosophy (and scientific computing libraries) of Python. I don’t spend enough time programming each week to keep Perl in my head, but I can remember Python. However, I could imagine someone being very productive in Perl 6 if they use it full time.

  4. Christian Sciberras

    Being a PHP developer, Perl looks familiar to me, but I personally dislike using it, mostly because of its syntax (similar to my problem with C/C++, except that these two have a philosophy that just doesn’t work for me).

    Anyway, you said something which really caught my attention: For a programming language designed in 10 days, he did an amazing job.

    In my eyes, languages like PHP, CSS, HTML and Javascript are powerful not because of their extensive instruction set, but rather because of their simple and predictable syntax. That’s the advantage to them. The disadvantage, it seems, is that the standards working group seems to be expanding in more areas than it can possibly cover.

    I trust you’ve seen the features in the next version of ecmascript? Well, I’d be damned if they didn’t fill it with more bloat. A similar story? Google’s approach to this with, eg Go.
    Well, I can’t speak for all web developers out there, but I’m pretty sure they prefer consistent behavior over eye-popping features from standards.
    So why are browsers trying to implement as much experimental standards as possible, while breaking existing code time and time again?

    Anyway, enough ranting from my side! I’ll give Perl another look sometime in the future, though I can’t say I’ve had use for it [which other languages I know wouldn’t cover].

  5. Hi John

    Are there some performance numbers to compare Perl 6 with other popular programming languages? IIRC, Perl 5 was quite slower than traditional languages such as C, Java etc.

    Regards

  6. It depends greatly on what task you’re doing. I’ve seen benchmarks where Perl slightly outperformed C on some task, but was 500x slower than C on some other task.

    Perl 6 is even more complicated to benchmark because they’re emphasizing Perl 6 as a language specification, not an implementation. So before you could talk about performance, you’d have to specify an implementation: running on Parrot, JVM, .NET, etc.

Comments are closed.