3 ms·
It's all the little things they screw up by trying to turn JS into Java. It seems like that's the way to 'improve' the language (add 'proper' classes, 'proper'
by gruseom 16y ago
It's all the little things they screw up by trying to turn JS into Java. It seems like that's the way to 'improve' the language (add 'proper' classes, 'proper' typing). But the result is a mishmash. They've added stucco to an oil painting. Sorry for the lack of specific examples, but my way of dealing with the incessant irritations is to deliberately forget them.
Even the performance is misleading. It comes from one thing, the static typing, and having played that card there doesn't seem to be anywhere else for them to go. AVM2 bytecode is very interesting; if you try to optimize it you get counterintuitive results: it either stays the same or gets slower. (The one exception is the fast memory opcodes that were added for the abortive Alchemy project, but that's another story.)
The proper point of comparison is V8. Adobe had an eternity of a head start. They just bet on the wrong horse. Had they understood the problem more deeply they could have grabbed the V8 guys before Google even thought about it. In that case their head start might have turned into total dominance of the browser runtime. The biggest advantage Flash has -- 95%+ market penetration -- is one of the most valuable assets on the internet. (Is any single asset more valuable? I mean executables, as in IE counts but google.com doesn't.) Imagine if Adobe had done V8 before Chrome existed. The few users who didn't have Flash would have had to install it just to make web apps usable. People might not have bothered for a 2x speedup, but a 1000x speedup? I think so.
Edit: to be clear, I'm not talking about (heaven forbid) Flash apps. I'm saying that Flash could have become the standard runtime for web apps. They were on the VM performance track years before anyone else. But it's easy to see that they weren't thinking about this at all, because the facilities for communicating between Flash and the browser are unbelievably poor. (They actually marshal all calls into XML messages! Grrrrrrraaaaaaagh.)
- acqq 16y ago> Sorry for the lack of specific examples, but my way of dealing with the incessant irritations is to deliberately forget them. Pity, as the rest of us then can't learn anything without the examples of the errors. > I'm not talking about (heaven forbid) Flash apps. I'm saying that Flash could have become the standard runtime for web apps. And how were they supposed to reach that when having only Flash which runs as it runs? How were they to make a whole browser that would be widely accepted? What do you think they should have done actually?
- gruseom 16y agoWhat do you think they should have done actually? What I said: make the fastest JS VM in the world years before others got started and make it cheap to call into from the browser. Then web apps could have used Flash's JS if it were available and just run more slowly if it weren't. Since V8 runs far faster than AS3 (in any measurement I've done), this was obviously technically possible. Had Adobe done this, Flash's extraordinary ubiquity would have meant we had access to something like V8 in nearly every browser out there, right down to IE6. Instead, what they produced was a dead end -- faster than the old JS implementations but not as fast as the new ones -- and a monstrosity called ExternalInterface that makes interaction between JS and AVM2 too slow for all but the most expensive computations.
- acqq 16y ago> make the fastest JS VM > ExternalInterface that makes interaction between JS and AVM2 So how were they to have a JS VM without the overheads but not making a full browser? Note that Google doesn't manage that either, they just have the thing that inserts the whole Chrome window in the IE frame. (The examples or specifics for each your claim are still missing).
- gruseom 16y agoThey could have started by not translating every single ExternalInterface call into XML and then back again. However, this is a useless argument: my thoughts are just a silly thought experiment and you're just being adversarial. Tell you what, have a free point on me.
- BrendanEich 16y agogruseom's what-if sounds a lot like my ScreamingMonkey plan of 2007: http://brendaneich.com/2007/07/new-projects/ http://brendaneich.com/2007/07/new-projects/ https://wiki.mozilla.org/Tamarin:ScreamingMonkey https://wiki.mozilla.org/Tamarin:ScreamingMonkey The idea was for Tamarin to be as fast as V8 on untyped JS, and (via the Flash vector) distributed and integrated with all IE versions via the COM ActiveScripting interfaces to the native DOM and browser objects. This was harder than it sounds. Tamarin was not fast on untyped code and the work to make it so never happened. We at Mozilla paid Mark Hammond to do the COM integration with IE, but he ran into global object API mismatches and couldn't make progress without help from Adobe. ES4 failed and Adobe departed. ChromeFrame is really a super-ScreamingMonkey, but will it get distribution on the scale that Flash has? If it did, I bet authors would target it. With IE9 there's less need for it, but IE8 on Windows XP seems likely to be the "new IE6". I suspect something different will happen from the best laid plans of Alex et al. for ChromeFrame, just as our ScreamingMonkey dreams died. Either Microsoft will manage to move people off of XP, or other browsers will convert most XP users to switch from IE8, or something I can't foresee, but not ChromeFrame ubiquity, will happen.