News for hackers. Stuff that matters.
Re:Ask HN: A New Decade. Any Predictions? (2010) by wycy on Thursday January 02, 2020 @07:45PM (#21941749)
Doesn’t that describe the rise of JavaScript? I haven’t done or seen any specific benchmarks, but I gathered that JS was among the slowest of languages.
Re:Ask HN: A New Decade. Any Predictions? (2010) by hyperpape on Thursday January 02, 2020 @08:41PM (#21942160)
Like others have said, major Javascript engines are much than Ruby implementations, owing to the huge effort Firefox, Google, Apple, and Microsoft have put into those engines. In principle, I'm not sure if there's reasons that make one intrinsically harder to optimize.

But even if Javascript were slower, it wouldn't mean the prediction was right. Javascript didn't do something super amazing that let you write beautiful code (the way Rubyists feel about Ruby, or Python folks feel about Python). It just ran the web so we used it. Over time, it's morphed into a language that's about as expressive as any other good dynamic language, also with some warts. But it's not a leap ahead, which is what the original post predicted.

The only language I've felt that way about was Prolog. When it works right, it's amazing. Too bad I can rarely make that happen.

Re:Ask HN: A New Decade. Any Predictions? (2010) by jaggirs on Friday January 03, 2020 @05:31AM (#21944748)
I am convinced there has to be a way to leverage the expressive power of a language like pure prolog without the strain of the 'hints' you need to give it when the depth-first algorithm can't solve the problem. My bet is that if the interpreter 'knows' enough algorithms to solve common calculations, it could leverage these to compute 90% of problems (without needing to have one algorithm for each problem). For the other 10% you would have to supply the interpreter with the necessary algorithms yourself.
Re:Ask HN: A New Decade. Any Predictions? (2010) by kibwen on Thursday January 02, 2020 @07:56PM (#21941844)
JS is pretty much the fastest of the popular dynamic langs, if only because JS interpreters see highly-competitive investment from well-funded companies with armies of developers thanks to the web.
Re:Ask HN: A New Decade. Any Predictions? (2010) by ratww on Thursday January 02, 2020 @07:53PM (#21941815)
No, it's pretty fast [1].

Chrome and V8 were released in 2008, and Node.js (which leverages V8) in 2009. V8 was already considered fast back then. Mozilla and Apple also focused on optimizing their JS stack in the following years.

[1] I'm not a fan of linking to benchmarks, but that's the best I can do: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... / https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re:Ask HN: A New Decade. Any Predictions? (2010) by jashmatthews on Thursday January 02, 2020 @09:33PM (#21942534)
Google’s marketing for Chrome and V8 was incredibly effective. We’ve basically forgotten that Mozilla, Adobe and Apple were pushing JS perf long before V8 was released. Memory usage of early V8 was atrocious and real world performance was barely improved over Safari and Firefox but Google dominated dev mindshare for a decade.
Re:Ask HN: A New Decade. Any Predictions? (2010) by kragen on Friday January 03, 2020 @10:51AM (#21946914)
No, Mozilla and Apple didn't release their JIT engines until after Chrome (though I think at least Apple was working on theirs) and so when Chrome came out JS immediately got about 4x faster, which was a bigger improvement than had happened over the entire previous lifetime of JS. Popular web pages didn't immediately get 4x faster, because they had carefully avoided doing anything in JS if its performance mattered, but JS did. It's true that V8 used a ridiculous amount of RAM, and still does, but its existence made it possible to do things in JS that previously required native code.

As for Adobe, they never did much for JS; they tried to get people to use ActionScript instead, which was a statically-typed language with syntactic similarities to JS.

Re:Ask HN: A New Decade. Any Predictions? (2010) by jashmatthews on Friday January 03, 2020 @04:46PM (#21950708)
Apple built the Sunspider benchmarks in 2007, and along with Mozilla, they made dramatic real world performance improvements before Chrome was even publicly announced.

https://webkit.org/blog/152/announcing-sunspider-09/ https://webkit.org/blog/214/introducing-squirrelfish-extreme...

Chrome + V8 was already behind in real world performance, not ahead!

http://www.satine.org/archives/2008/09/19/squirrelfish-extre...

Macromedia (later Adobe) funded a whole bunch of JIT research as the Tamarin Tracing project, which was shared with Firefox as TraceMonkey. The NanoJIT assembly backend was actually shared code.

Re:Ask HN: A New Decade. Any Predictions? (2010) by kragen on Friday January 03, 2020 @09:18PM (#21952338)
I guess you're right that TraceMonkey was announced before Chrome was released on 2007-09-02, one day after its inadvertent public announcement. TraceMonkey was announced, though incomplete, more than a week earlier, 2008-08-23: https://brendaneich.com/2008/08/tracemonkey-javascript-light.... SFX, however, was announced later, 2008-09-18.

I don't want to piss too much on SunSpider, but unsurprisingly V8 did better on V8’s benchmarks, while SFX and TM did better on SunSpider, once they were eventually released. That's because V8 was written to do well on its benchmarks, presumably, not because the benchmarks were rigged. Certainly they were in accordance with my experience at the time.

When Chrome was released, V8 was way ahead of the other browser JS engines at JS performance, partly because it had the first JS JIT. But the other browsers took a year or two to catch up, which they had because it also took websites a few years to move most of their functionality into browser JS.

I don't know why you keep emphasizing this “real-world” thing. Are you saying you think nbody and fannkuch are especially realistic benchmarks?

You're right though that Tamarin was a JS engine, not just an AS engine. We regret the error.

Re:Ask HN: A New Decade. Any Predictions? (2010) by jashmatthews on Friday January 03, 2020 @10:07PM (#21952567)
The point is Mozilla, Apple and Adobe did enormous work on JS before Chrome was released.

nbody and Fannkuch are meaningless for real world performance on a client side JS app. V8s benchmarks were widely considered to be unrepresentative of what browsers actually do. Sunspider and derivatives were the most realistic tests at the time and Chrome wasn’t a dramatic improvement.

https://johnresig.com/blog/javascript-performance-rundown/

Chrome’s marketing was incredibly successful in getting more people to use a browser better than IE but it didn’t have a dramatic improvement over FF or Safari.

Re:Ask HN: A New Decade. Any Predictions? (2010) by kragen on Saturday January 04, 2020 @12:10AM (#21953010)
> The point is Mozilla, Apple and Adobe did enormous work on JS before Chrome was released.

That's true relative to the work they had done on, for example, Gopher support, but it's not true relative to the work they did after Chrome was released. As I said, JS performance from 1995 to 2008 hadn't increased by even a factor of 4; then Chrome was released in 2008 and it immediately increased by a factor of 4, more than it had increased in the entire previous 13-year history of JS. It's true that there existed other optimization efforts. But they weren't successful, probably because not nearly enough effort was devoted to them. Tamarin Tracing/TraceMonkey was eventually discarded and is not part of SpiderMonkey today, although a different JIT strategy is. (LuaJIT uses the tracing-JIT strategy very successfully, though.)

> nbody and Fannkuch are meaningless for real world performance on a client side JS app. V8s benchmarks were widely considered to be unrepresentative of what browsers actually do. Sunspider and derivatives were the most realistic tests

I mentioned nbody and fannkuch because they are in SunSpider, so it seems that you are contradicting yourself in addition to, as demonstrated previously, mixing up the historical sequence of how things happened.

I had just written a parser generator and an experimental functional language that compiled to JS when Chrome came out, and the performance improvements I saw were in line with the Chrome benchmarks. My experience is not part of Google's marketing.

Re:Ask HN: A New Decade. Any Predictions? (2010) by jashmatthews on Saturday January 04, 2020 @01:35AM (#21953294)
Safari perf had already improved more than 4x with the move from AST Interpretation to a register based bytecode VM with SquirrelFish. This happened before Chrome.

I’m working on a tracing JIT for Ruby at the moment partially inspired by LuaJIT. Fingers crossed it’ll be published research this year!

Right, but the Sunspider benchmark also tested strings, regex and date manipulation. V8s original benchmarks didn’t. Performance on stuff like a parser generator was way up, but it didn’t run jQuery based Ajax sites any faster.

Re:Ask HN: A New Decade. Any Predictions? (2010) by kragen on Saturday January 04, 2020 @03:17AM (#21953645)
Best of luck with that! I look forward to seeing it.
Re:Ask HN: A New Decade. Any Predictions? (2010) by kragen on Saturday January 04, 2020 @12:21AM (#21953043)
> before Chrome was released on 2007-09-02

This should read, "before Chrome was released on 2008-09-02".

Re:Ask HN: A New Decade. Any Predictions? (2010) by igouy on Friday January 03, 2020 @12:27PM (#21948077)
fwiw n-body 2009

10x JavaScript V8 211.76 secs

100x Ruby 1.9 #2 34 min

106x JavaScript TraceMonkey 36 min

http://web.archive.org/web/20090705014239/http://shootout.al...

Re:Ask HN: A New Decade. Any Predictions? (2010) by jashmatthews on Friday January 03, 2020 @04:53PM (#21950770)
Real world performance was the opposite story, with Safari's super efficient bytecode VM out performing V8s JIT: http://www.satine.org/archives/2008/09/19/squirrelfish-extre...
Re:Ask HN: A New Decade. Any Predictions? (2010) by mattmanser on Thursday January 02, 2020 @08:00PM (#21941879)
No, it really wasn't. You had to use it in really specific ways and it had all sorts of gotchas. One I vaguely remember is that if an array got too big performance would tank like crazy.
Re:Ask HN: A New Decade. Any Predictions? (2010) by austincheney on Friday January 03, 2020 @09:12AM (#21945960)
Did anybody predict the slow death of jQuery or the rise of giant monster JavaScript frameworks? 2010 is when jQuery was a cult of personality. It was everywhere and any criticism of it was quickly met with desperate mob violence.

Did anybody predict a typical corporate web page would require 3gb of JavaScript code from frameworks and thousands of foreign packages just to write a couple of instructions to screen?

Re:Ask HN: A New Decade. Any Predictions? (2010) by rsynnott on Friday January 03, 2020 @08:48AM (#21945764)
Applications written in JavaScript tend to be hideously slow (and getting worse) but this is more of a community problem; the language itself is now rather fast by dynamic language standards.
Re:Ask HN: A New Decade. Any Predictions? (2010) by lern_too_spel on Thursday January 02, 2020 @10:45PM (#21942932)
JavaScript is now both faster and less productive than Ruby, so it doesn't match his prediction that a slower and more productive language will become popular.
Re:Ask HN: A New Decade. Any Predictions? (2010) by goatlover on Friday January 03, 2020 @09:10PM (#21952301)
What it does show is that being a web standard trumps everything else.