LWN.net Logo

Javascript speed

Javascript speed

Posted Sep 2, 2008 14:03 UTC (Tue) by epa (subscriber, #39769)
Parent article: The Google Chrome comic book

It seems like every week there is an announcement of a new Javascript engine which will make everything so much faster than before and will be included in $Browser real soon now. Are there any meaningful benchmarks of Javascript performance compared to say Perl, Python, C# and Java? Should people start using Javascript for general scripting tasks and applications outside the browser, if it's really so fast?


(Log in to post comments)

Javascript speed

Posted Sep 2, 2008 14:34 UTC (Tue) by tjc (guest, #137) [Link]

> Should people start using Javascript for general scripting tasks and applications outside the browser, if it's really so fast?

I'd like that, although I don't think it will ultimately be any faster than any other language with similar features. But a lot of people already know it, since it's the only practical choice for client-side web programming, and it would be nice to be able to write server-side scripts in the same language.

Javascript speed

Posted Sep 2, 2008 15:25 UTC (Tue) by rfunk (subscriber, #4054) [Link]

There are standalone javascript interpreters that you can run on your server. KDE has kjscmd, and Mozilla has Spidermonkey and (if you want to run JS on the JVM) Rhino.

They probably should

Posted Sep 2, 2008 17:12 UTC (Tue) by khim (subscriber, #9252) [Link]

Actually the fact that there are a lot of JITs and different implementations means it'll be fastest scripting language in a few years. People are doing work in parallel - and it's more-or-less at the point which took more the decade for python/perl/whatever and still is not ready to be really used in production. Now they'll start to pull ideas from implementations supplied by others...

Hopefully someone will rip these V8 engine and put it in some small binary usable in shebang script's line...

Javascript speed

Posted Sep 3, 2008 0:46 UTC (Wed) by gouyou (subscriber, #30290) [Link]

I would much prefer everybody integrating a nicer language like python in the browser. Javascript is useful but the syntax and libraries are dreadful.

Javascript speed

Posted Sep 3, 2008 4:27 UTC (Wed) by flewellyn (subscriber, #5047) [Link]

On libraries, I'll agree...somewhat. It's only recently been taken seriously as a language, so library support is uneven. But I rather like Javascript's semantics; it's like a curly-braced Lisp.

Javascript speed

Posted Sep 3, 2008 20:09 UTC (Wed) by robertm (subscriber, #20200) [Link]

Only without all the parts that make Lisp different from all the other scripting languages out there: a useful code/data correspondence; lexically scoped non-local returns; an object system based on generic functions instead of message passing; resumable exceptions; dynamically-scoped variables.

Javascript speed

Posted Sep 3, 2008 21:40 UTC (Wed) by flewellyn (subscriber, #5047) [Link]

Fair enough. Still, it's got closures and good function/object polymorphism.

Javascript speed

Posted Sep 4, 2008 8:05 UTC (Thu) by nix (subscriber, #2304) [Link]

And macros. Don't forget macros. (I suppose this is a consequence of
the 'useful code/data correspondence' that you did mention.)

Javascript speed

Posted Sep 3, 2008 19:00 UTC (Wed) by tjc (guest, #137) [Link]

It could be a *lot* worse. As a Python programmer you should at least appreciate the fact that semicolon statement terminators are optional.

Myself, I like the first-class funtions, and the somewhat oddball prototype-based objects. I'm less thrilled with the way it silently converts objects from one type to another, in sometimes unexpected ways, but most scripting languages do this to some extent.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds