Hacker News new | past | comments | ask | show | jobs | submit login

> As a scripting language, excluding all bindings (files, networking, etc), JavaScript is substantially faster than Ruby or Python.

This makes no sense.

They're all dynamically typed languages (avoiding the term "scripting languages" since it's pretty vague).

The only reason for the difference in speeds between these languages is due to the quality of their interpreters, not the languages themselves.




> The only reason for the difference in speeds between these languages is due to the quality of their interpreters, not the languages themselves.

That's not entirely true; there've been fairly good write-ups on particular elements of language semantics for which support inhibits VM performance; for instance, there were particularly good write-ups a while back by the JRuby team (Charles Nutter, specifically, IIRC) on Ruby semantics that are problematic in that respect.

Obviously, that doesn't mean that the level of investment by major firms in the interpreters doesn't have an impact, and Node is definitely riding high on Google's investment in making V8 speedy for Chrome. But language differences do matter.


Yeah, since PyPy is V8 fast, LuaJit is faster, and Julia is even faster.


I'm not a PL expert, but Ruby's semantics seem much more complicated than JavaScript's.


Perhaps, but Ruby is are more consistent. There is no implicit conversion, no optional semicolons, no dynamic this, the inheritance chain is not disguised by Java-like syntax, everything is an object (there are no primitives), object construction is always uses the .new method, containers mixin Enumerate for a consistent API across arras, hashes, etc. There's no need for "use strict" or built-in statements like with to ignore. All operations are messages between objects. You can extend the semantics by defining message operation on an object, so that you can use + for more than the builtin classes, where it makes sense to do so.


If you have embedded or extended a scripting language it makes perfect sense.

Repeating myself just for you: I was referring specifically to benchmarking language aspects excluding bindings to native code such as files, networking, processes, etc.

e.g: https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...

Then sure, JavaScript has many implementations, so does Ruby and Python. I was referring to v8 (used by node), CPython and Ruby MRI in particular.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: