What I think Google should do is build a Silverlight competitor that is open source. What's the point of this Javascript hacking with suboptimal results?
GWT 2.0
31–34 of 34 posts
Re: GWT 2.0
#32Earlier quoted context omitted.
I think Google is actually thinking javascript is going to be the base machine language of the browser. They seem to be investing a lot of effort on the V8 engine. http://code.google.com/p/v8/
Does V8 compile to a bytecode similar to Java? I know that it does JIT compilation to native code and then caches it for future use. If it happens to have a bytecode representation, we could read the Google tealeaves and conclude that Google sees compiled JavaScript as an ugly steppingstone toward a binary representation of client-side code.
AFAIK, not any remotely standardized bytecode, no. Of course, there are some data structures in between the strings of characters and the native code, but I don't think there's any talk of guaranteeing anything that would warrant calling them "byte code".
Aside: Lars Bak is the lead developer on V8, and was the lead on HotSpot - http://en.wikipedia.org/wiki/Lars_Bak_(computer_programmer)
Re: GWT 2.0
#33Earlier quoted context omitted.
Exactly, it's not just about speed. It's about a lot of things including market penetration, language usage, and speed. By choosing Javascript, Google automatically wins on the first two points and is making Javascript kick ass in the third. Market penetration is a -huge- aspect of coding in the browser. It's the reason Flash won't die; Adobe is really, really good at pushing the plugin on people. If people can't run…
> Of course, Silverlight and Flash both beat the pants off of Javascript for practically every benchmark. Last I checked, this is not true. In my darker days, I spent six months on a contract developing a third party full screen media browser for Windows Media Center Edition. Windows MCE is basically a giant IE window, and your apps are web pages. The architect benchmarked flash vs javascript at the time, and javascr…
Chrome's V8 engine is awesome. I never realized it.
Re: GWT 2.0
#34Earlier quoted context omitted.
"Silverlight will always be much faster" Anything to back this up?
You can generate faster code with static typing.
The CLR is not that great. For instance, it can't optimize call-sites of virtual methods ... the JVM does it, Chrome's V8 probably does it too.
And yes, you can use IronPython and IronRuby ... but in case you haven't checked them out ... those are awfully slow (mildly put) compared to the reference or the JVM implementations (go figure).
If you can optimize the call-sites of virtual methods (a problem which isn't solved by static-typing), there's nothing inherent in static typing that guarantees faster code, except the handling of primitives ... numbers mostly, because if numbers are boxed, math is slow. But when you're building a VM from scratch (like what Google is doing with the V8) you can workaround that too (see Lua for a shiny example). Well ... there are other things too, like making classes/interfaces dynamic, but this isn't such a big problem).
What I find interesting about V8 ... even if its designed only for Javascript, the type-system itself is dynamic enough to make V8 a good target for other dynamic languages. And a modified application server could compile something like ...
document.find('div.item').each do |item|
item.append("hello world");
end
... to Javascript without much trouble.And V8 probably has certain constructs that are executed faster, so you could have a Java to Javascript compiler (like GWT) that uses those static-types that you love to generate faster Javascript.
And with HTML5, you can have your cake and eat it too (assuming Microsoft plays along, or Firefox/Safari/Opera/Chrome become much more popular ... not so hard to imagine given IExplorer's flaws, the army of developers preferring modern browsers and UE's antitrust policies).