Live data from Hacker News

Mozilla can produce near-native performance on the Web

arstechnica.com

191–200 of 202 posts

Re: Mozilla can produce near-native performance on the Web

#191

Earlier quoted context omitted.

Quick reply (thanks for the well-formatted cited text!). * Java didn't have the bad security rep until relatively recently. Java had nice-looking UX in the 90s (Netscape bought Netcode on this basis), much nicer than Web content. Didn't help. * Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled…

>* Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled 3DS Max (see my blog on OTOY for more). The reasons behind these outcomes should be clear. They have little to do with JS lacking Java's big-OO features. I am actually not defending big-OO features (I think, 90s style big-OO is obsolete). I l…

Tern's static analysis is based loosely on SpiderMonkey's type inference, which does well with most JS libraries.

Yes, some overloaded octopus methods fall back on Object. What helps the SpiderMonkey type-inference-driven JIT is online live-data profiling, as Marijn notes. This may be the crucial difference.

However, new algorithms such as CFA2 promise more precision even without runtime feedback.

And I suggest you are missing the bigger picture: TypeScript, Dart, et al., require (unsound) type annotations, a tax on all programmers, in hope of gaining better tooling of the kind you work on.

Is this a good trade? Users will vote with their fingers provided the tools show up. In big orgs (Google, where Closure is still used to preprocess JS) they may, but in general, no.

Renaming is just not high-enough frequency from what I hear to motivate JS devs to swallow type annotation.

/be

Re: Mozilla can produce near-native performance on the Web

#192

Earlier quoted context omitted.

>What a formatting mess -- I hope you can you still edit your post and put two newlines after the >-cited lines from my post, and the text where you start replying? Thanks. Sorry, for the bad formatting, when I understood that it's broken I wasn't able to edit it. >At this point on USENET, you'd hear a plonk. But I'll close with one more point: I didn't want to argue with you, I just described how it looked to me (an…

Not looking to argue, just add some value: you say "too much time until it happens" and I've heard that before, many times -- most recently re: Dart (see that Channel 9 Lars&Anders interview). Funny thing, it has been years since Dart started, ditto PNaCl. Who says JS is the slow path? I suspect it will get there faster (for tangible definitions of "there", e.g., a Rust2JS compiler for you) with well-focused work. /b…

> Rust2JS

Pretty please! Excited to see pcwalton's zero.rs work, which I understand to be a prerequisite for a Rust2JS. But deeper JS integration than emscripten currently provides (e.g., mapping rust structs to harmony binary data StructTypes?) would be even more awesome. When are you going to land 749786, anyway?

Re: Dart and PNaCl--they've been useful for providing political cover to people who want to evolve JS more aggressively.

Re: Mozilla can produce near-native performance on the Web

#193

Earlier quoted context omitted.

Not looking to argue, just add some value: you say "too much time until it happens" and I've heard that before, many times -- most recently re: Dart (see that Channel 9 Lars&Anders interview). Funny thing, it has been years since Dart started, ditto PNaCl. Who says JS is the slow path? I suspect it will get there faster (for tangible definitions of "there", e.g., a Rust2JS compiler for you) with well-focused work. /b…

> Rust2JS Pretty please! Excited to see pcwalton's zero.rs work, which I understand to be a prerequisite for a Rust2JS. But deeper JS integration than emscripten currently provides (e.g., mapping rust structs to harmony binary data StructTypes?) would be even more awesome. When are you going to land 749786, anyway? Re: Dart and PNaCl--they've been useful for providing political cover to people who want to evolve JS m…

Heh, I really do need to land int64/uint64 support. The patch needs tests and some cleanup first. This week may afford some hacking time (finally) instead of just rebasing time.

In theory it shouldn't be necessary to mal-invest in long-odds/single-vendor (and therefore hard to standardize without dominant market power) innovations at high cost, just to drive minimal investment in evolving the web in shorter-odds ways. Especially when the same company is collaborating in TC39 to evolve JS, and owns the V8 engine!

Competitive strategy or just a side effect? I suspect the latter, and even if strategy, it's not cheap. Anyway, we didn't need it as cover to do asm.js. That came from @azakai's work on Emscripten plus Mozilla Research's "make the Web better" agenda and answer the "JavaScript -- is there anything it can't do?" q. with results (negative or positive).

/be

Re: Mozilla can produce near-native performance on the Web

#194

Earlier quoted context omitted.

>Look around you at the Web: all the top sites use JS heavily and without "heroic efforts" compared to Java (dead on the client) or .NET (WPF is dead too). Java isn't used in the browser because of awfully bad user experience, and bad security (personally, I disabled Java in the browser). JavaScript applications just look much better and behave much more smoothly, which is more important on the web than ease of devel…

Quick reply (thanks for the well-formatted cited text!). * Java didn't have the bad security rep until relatively recently. Java had nice-looking UX in the 90s (Netscape bought Netcode on this basis), much nicer than Web content. Didn't help. * Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled…

"JS can be evolved far more easily than it can be replaced." - this sums up everything :)

Re: Mozilla can produce near-native performance on the Web

#195

Earlier quoted context omitted.

>To make such an airy assertion in an under-researched comment makes me suspect that you don't know that much about either PNaCl or "any browser". So why did you make that confident-sounding claim? Unfortunately, I can evaluate technologies according only to my experience and knowledge. According to my limited knowledge and experience, what PNaCl evolves to seems like the way to go: I can use whatever language I like…

What a formatting mess -- I hope you can you still edit your post and put two newlines after the >-cited lines from my post, and the text where you start replying? Thanks. If I can read through the mess, you seem to be saying you can't evaluate PNaCl, so you'll just make airy and overconfident assertions about it. Even on HN, that doesn't fly. -1! When I challenge your further assertion that something is "easily inte…

I hate Javascript. Sorry if this offended anyone. I think it was good for its limited use case during the early Web 1.0 - Web 2.0 era.

So therefore I dont like asm.js either. I much prefer LLVM or PNaCI. But that is in an ideal world. In real world i would have to agree asm.js seems the way forward. Even with asm.js being a shortcut, it would still take many years for it to gain enough traction and improvement to be really useful as an universal compiler target. Much like what is currently happening now with JVM. Except almost everyone already has a JS Engine Installed, no need to download a Java Runtime.

That way everyone can really use what ever languages that love or they want. With Everything2js.

I hope the future evolution of Javascript will take performance as a consideration. Such as SIMD etc.

May the day of languages independent web come faster.

Re: Mozilla can produce near-native performance on the Web

#196
post #195

Earlier quoted context omitted.

What a formatting mess -- I hope you can you still edit your post and put two newlines after the >-cited lines from my post, and the text where you start replying? Thanks. If I can read through the mess, you seem to be saying you can't evaluate PNaCl, so you'll just make airy and overconfident assertions about it. Even on HN, that doesn't fly. -1! When I challenge your further assertion that something is "easily inte…

I hate Javascript. Sorry if this offended anyone. I think it was good for its limited use case during the early Web 1.0 - Web 2.0 era. So therefore I dont like asm.js either. I much prefer LLVM or PNaCI. But that is in an ideal world. In real world i would have to agree asm.js seems the way forward. Even with asm.js being a shortcut, it would still take many years for it to gain enough traction and improvement to be…

Some days, I hate JS too. But hate leads to the dark side. It is what it is. Might as well hate endosymbionts who power our cells for being ugly.

We're all over performance, including SIMD. Multiple approaches but definitely up for the Dart-like direct approach. Talking to John McCutchan of Google about lining up JS on this front so Dart2JS has a complete target.

/be

Re: Mozilla can produce near-native performance on the Web

#197

Earlier quoted context omitted.

>* Web != Desktop. Large desktop apps are the wrong paradigm on the web. You won't see a Web-based Mathematica rewritten by hand in HTML/JS/etc. You will see Emscripten-compiled 3DS Max (see my blog on OTOY for more). The reasons behind these outcomes should be clear. They have little to do with JS lacking Java's big-OO features. I am actually not defending big-OO features (I think, 90s style big-OO is obsolete). I l…

Tern's static analysis is based loosely on SpiderMonkey's type inference, which does well with most JS libraries. Yes, some overloaded octopus methods fall back on Object. What helps the SpiderMonkey type-inference-driven JIT is online live-data profiling, as Marijn notes. This may be the crucial difference. However, new algorithms such as CFA2 promise more precision even without runtime feedback. And I suggest you a…

>And I suggest you are missing the bigger picture: TypeScript, Dart, et al., require (unsound) type annotations, a tax on all programmers, in hope of gaining better tooling of the kind you work on.

In many cases types can be inferred. ML is able to infer almost all types in a program (however the algorithm requires that the language doesn't have subtyping). Haskell has very good type inference which support subtyping (you declare very few types). They both have strong static type system and don't tax developers by making them having to declare every type. Algorithms which are used in Haskell are complicated, but they can be implemented.

Re: Mozilla can produce near-native performance on the Web

#198

Earlier quoted context omitted.

Tern's static analysis is based loosely on SpiderMonkey's type inference, which does well with most JS libraries. Yes, some overloaded octopus methods fall back on Object. What helps the SpiderMonkey type-inference-driven JIT is online live-data profiling, as Marijn notes. This may be the crucial difference. However, new algorithms such as CFA2 promise more precision even without runtime feedback. And I suggest you a…

>And I suggest you are missing the bigger picture: TypeScript, Dart, et al., require (unsound) type annotations, a tax on all programmers, in hope of gaining better tooling of the kind you work on. In many cases types can be inferred. ML is able to infer almost all types in a program (however the algorithm requires that the language doesn't have subtyping). Haskell has very good type inference which support subtyping…

I know about ML and Haskell but let's be realistic. Neither is anywhere near ready to embed in a browser or mix into a future version of JS.

We worked in the context of ES4 on gradual typing -- not just inference (as you imply, H-M is fragile) -- to cope with the dynamic code loading inherent in the client side of the Web. Gradual typing is a research program, nowhere near ready for prime time.

Unsound systems such as TypeScript and Dart are good for warnings but nothing is guaranteed at runtime.

A more modular approach such as Typed Racket could work, but again: Research, and TR requires modules and contracts of a Scheme-ish kind. JS is just getting modules in ES6.

Anyway, your point of reference was more practical systems such as Java and .NET but these do require too much annotation, even with 'var' in C#. Or so JS developers tell me.

/be

Re: Mozilla can produce near-native performance on the Web

#199

Earlier quoted context omitted.

I switched to Chrome shortly after FF 3.6 and have only looked back 3 or 4 times since.

3.6 was a while ago, and I believe you didn't need add-ons to have the trouble you describe. I use Firefox and Chrome every day. My results line up with recent HN comments about how Firefox is competitive, uses less memory at scale (lots of tabs), still janks worse, but may be actually more stable at the moment. Flash is a big source of instability still, for both browsers. My bottom line: both Firefox and Chrome are…

You are far from the first Mozilla employee that has responded to my complaints about Firefox, but you are the only one thus far that has been civil. In fact, just a few days ago, I was trolled on twitter by a Mozilla employee over my responses here.

So, I just wanted to say thank you.

Re: Mozilla can produce near-native performance on the Web

#200

Earlier quoted context omitted.

3.6 was a while ago, and I believe you didn't need add-ons to have the trouble you describe. I use Firefox and Chrome every day. My results line up with recent HN comments about how Firefox is competitive, uses less memory at scale (lots of tabs), still janks worse, but may be actually more stable at the moment. Flash is a big source of instability still, for both browsers. My bottom line: both Firefox and Chrome are…

You are far from the first Mozilla employee that has responded to my complaints about Firefox, but you are the only one thus far that has been civil. In fact, just a few days ago, I was trolled on twitter by a Mozilla employee over my responses here. So, I just wanted to say thank you.

Sorry to hear about the trollery. I'm looking into it.

I wonder if you have a profile that goes back years and has some property that tickles a latent bug. Sorry if I missed it: have you tried running on a brand new profile? You'll have to use the -ProfileManager option on the command line at startup, I think.

/be

Post reply on HN