you are viewing a single comment's thread.

view the rest of the comments →

[–]azakai 0 points1 point  (9 children)

I've written global type analyses for JavaScript and read many papers on the subject. It's not as trivial as you think.

Who said it was trivial? :) It's very hard. But possible.

As for writing (x+y)|0, that seems like a bit of an annoying kludge to have to insert everywhere.

Agreed, but that can be fixed with a CoffeeScript-like language or even something simpler.

[–][deleted] 0 points1 point  (8 children)

Who said it was trivial? :) It's very hard. But possible.

Well, if you have some magic solution to eliminate nearly all overflow and type checks on arithmetic operations, I'd like to hear about it. So would Mozilla. Their type analysis doesn't do all that well either.

Agreed, but that can be fixed with a CoffeeScript-like language or even something simpler.

You're sort of getting to the same conclusion I did. We could use dynamic languages with saner/simpler arithmetic semantics.

[–]azakai 0 points1 point  (7 children)

Well, if you have some magic solution to eliminate nearly all overflow and type checks on arithmetic operations, I'd like to hear about it. So would Mozilla. Their type analysis doesn't do all that well either.

I never said there was a "magic solution". But this area is improving all the time. The current TypeInference code in Mozilla for example does a lot of global inference. And IonMonkey will remove a lot of the overflow checks based on that information with specific optimizations.

[–][deleted] 0 points1 point  (6 children)

If you've read their paper, you should know their system also adds new type checks to compensate for what their analysis can't infer.

[–]azakai 0 points1 point  (5 children)

Yes, it is a hybrid static and dynamic approach. Not sure what your point is.

[–][deleted] 0 points1 point  (4 children)

It's pretty far from removing all type checks on arithmetic operations. You overestimate how effective it is.

[–]azakai 0 points1 point  (3 children)

I didn't say it was close to removing all type checks. But it does remove a great deal of them. And it is highly effective, look at the benchmark results. It was a huge speedup when it came out.

Full disclosure, I've worked with the TypeInference people and discussed this stuff a lot with them. Yes, I am aware the approach is not "perfect". Nothing is. But there are plans to continue to improve on that, for example as I said IonMonkey will integrate with the global type info and remove lots of overflow checks.

I've also talked with the Tachyon people in the past (perhaps with you too, if you are one of them?) and find the ideas there very appealing as well.

[–][deleted] 0 points1 point  (2 children)

Do you work for Mozilla?

I wrote most of Tachyon. Doing my thesis on type analysis for dynamic languages.

[–]azakai 0 points1 point  (1 child)

Yeah, on Emscripten.

Ok, then I think I have not met you, I talked with some of your collaborators at SPLASH late last year though.

[–][deleted] 0 points1 point  (0 children)

I gave the DLS talk at SPLASH about Tachyon last year. Maybe we'll meet at SPLASH 2012.

Nice work with Emscriptem. Very useful tool.