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

Like others are mentioning, Javascript is clean, familiar, easy, and has some compelling language features to boot (closures, JSON, etc).

Cultural norms and design patterns in Javascript Land increasingly orbit around projects like jQuery. This sort of influence works out spectacularly-well if you've spent the last several years working countless hours on browser-side code and suddenly stumble on nodejs and its evented/closure style of programming. Perhaps this doesn't describe you, but from my vantage point, this describes a vast number of programmers. There are a lot of people in that demographic who want to be able to rapidly write out web apps in the same frame of mind client and server side and not have to switch to thinking in Python or Ruby.

The fact that V8's engine is competitively fast isn't hurting these efforts either.




The people who claim JavaScript is fast because of V8 have probably never used a fast language and platform in a situation where speed is important. V8 is fast compared to other JavaScript engines. It's very slow compared to most other languages. PLT Scheme, a non-fast Scheme platform, averages half the time of V8 in the flawed benchmarks game (single core, JavaScript cannot multithread.) Lua, a fast non-broken dynamic language with first-class functions averages between 3x and 100x as fast as V8, the fastest JavaScript engine.

http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

By definition they are flawed benchmarks, but you will have a hard time writing faster JavaScript code than equivalent code in most other platforms. In the case of Lua (and Python, and Perl, and many many others) the equivalent JavaScript code will also be as long or longer, and not as clean.

I'm not going to get mad at anyone for their choice to use JavaScript, but the uncritical repetition of sentences like "Thanks to V8 and other modern engines, JavaScript has become fast compared to optimized language/platform X" or "JavaScript offers these N features you won't find anywhere else" will not fly.


I think you're reading the shootout wrong. V8 is faster in most cases than Lua in those benchmarks. Often by a fairly large margin. The gap between V8 and Ruby and Python is even larger.


Compare LuaJIT, PLT, V8, Lua, JRuby, Python 3, Ruby 1.8, Perl, PHP -

http://shootout.alioth.debian.org/u32/which-programming-lang...


Look again -- V8 is faster than the regular Lua interpreter, not the Lua JIT, which is much faster than V8.




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

Search: