| Actually, there's a pretty good chance that a good Javascript engine will beat Silverlight (if it doesn't already). 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 ... <script language="ruby">
document.find('div.item').each do |item|
item.append("<i>hello world</i>");
end
</script>
... 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). |