HNHacker News
TopNewBestAskShowJobs

jfbastien

422 karma · joined November 27, 2013

https://twitter.com/jfbastien
submissionscomments
jfbastien··on Assembling WebAssembly
I think you're misunderstanding Fil's point: JS is more expressive, and can often encode more things in a smaller package.

For same-code wasm / asm.js / x86 comparison (not what Fil was talking about) see section 7.3: https://github.com/WebAssembly/spec/blob/master/papers/pldi2...

Additionally, WebAssembly definitely needs to be parsed. See: https://github.com/WebKit/webkit/blob/master/Source/JavaScri... and https://github.com/WebKit/webkit/blob/master/Source/JavaScri...

Granted, that's simpler than parsing JavaScript.

jfbastien··on Assembling WebAssembly
That is incorrect. See: https://github.com/WebAssembly/spec/blob/master/papers/pldi2...

These are already old numbers, and section 7.3 says 33.7% more efficient. Were one to run updated numbers, and use more than Chrome and Firefox, I'm pretty sure the numbers would be better still.

jfbastien··on Assembling WebAssembly
Not too bad. Some things are connected to GC and JIT-code generation, but if you wanted just BBQ or OMG (no tiering) something could be done. Tiering too, but then you have more of JSC in there, really depends what you want.

Depending on what you want to do, there are a few experimental .wasm -> LLVM IR -> machine code things around.

Problem is really what your embedder would be. Import / export is what you'd have to define! In JavaScript we have a standardized API for that.

jfbastien··on Assembling WebAssembly
No worries! It's all non-obvious :-) Yes GC == Garbage Collection.
jfbastien··on Assembling WebAssembly
See here: https://news.ycombinator.com/item?id=14501262 Proposal: https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...
jfbastien··on Assembling WebAssembly
It's quite a bit more than a frontend, but I agree it isn't as complex as the JS engine itself. For comparison, this is the JSC wasm implementation: https://github.com/WebKit/webkit/tree/master/Source/JavaScri...
jfbastien··on Assembling WebAssembly
Link to repro?
jfbastien··on Assembling WebAssembly
That's called B3 instead: https://webkit.org/blog/5852/introducing-the-b3-jit-compiler...
jfbastien··on Assembling WebAssembly
For reference, the current GC proposal is here: https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...

I expect it'll be discussed at an upcoming CG meeting. Either the next one or the one after.

jfbastien··on Assembling WebAssembly
Summarizing the "JSC <3 ES6" discussion and translating to WebAssembly: no ServiceWorker, polyfills from C++ / asm.js to WebAssembly won't be fast enough, "ES6" is a bad name and so is "WebAssembly", "we" is the WebKit team (as individuals), no tail call in WebAssembly but it's on the roadmap. https://news.ycombinator.com/item?id=14489577

Now that these points are out of the way, let's discuss implementation details, WebAssembly, and things!

jfbastien··on JSC loves ES6
We like using the element of surprise: https://www.youtube.com/watch?v=fG1TK6PdeVM
jfbastien··on JSC loves ES6
Interesting. What is that thing exactly? Is there a bug we can follow?
jfbastien··on JSC loves ES6
We're not speaking on behalf of WebKit, merely as members of the team explaining the team's approach. Neither are we trying to hide as "not divulging" implies.
jfbastien··on JSC loves ES6
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...

and

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

?

"finally" seems wrong here :)

I'll also note that Safari 10.1 was first with SharedArrayBuffer ;)

jfbastien··on JSC loves ES6
The WebKit team.

You like that question! Third time in this thread already

jfbastien··on JSC loves ES6
Your office is pretty tidy though.

But seriously, we have a bunch of developers asking for JavaScript improvements. Maybe OP doesn't want them, fine that's useful feedback... but it would be more easily received if it came in a nicer package :)

jfbastien··on JSC loves ES6
I think OP meant 2015 is two years ago, claiming it makes it look behind.

Truth is, ES6 is what we've called it, ES2015 is to confusing cool new name!

jfbastien··on Goodbye PNaCl, Hello WebAssembly
Except with all browser vendors being involved with WebAssembly, efficient polyfill-ability hasn't been a goal for a while.
jfbastien··on Learning to Superoptimize Programs
souper: https://github.com/google/souper
jfbastien··on WebAssembly Browser Preview
Who's a what now?
jfbastien··on WebAssembly Specification Prototype
I don't think you know much about emscripten. /trololol
jfbastien··on WebAssembly Specification Prototype
Browsers don't create laws. WebAssembly can't legislate. This is really out of scope!
jfbastien··on WebAssembly Specification Prototype
We're quotidian schmucks as well. We've thought about you :)

I mostly write C and C++ code, and if someone tries to give me hand-written assembly they better have a good reason (and sometimes they do!). Same goes for wasm: it's meant as a compiler target, not something humans write by hand. That's no different from all the compile-to-JS languages, asm.js, or any assembly.

Sure Joe Schmuck can still get stuck with angry assembly, but we haven't made the world a worst place in that respect.

And I'd argue wasm is making the world better in many other ways. :-)

jfbastien··on WebAssembly Specification Prototype
That would be awfully slow to transfer (or just verify) when most people never view the source map.

What's a "valid" source map anyways?

Furthermore, debugging with sourcemaps is suboptimal. WebAssembly wants to support much better debug information than this.

jfbastien··on No Sane Compiler Would Optimize Atomics
Paul wrote a memory model for Linux, with input from the Linux community: http://wg21.link/p0124r1
jfbastien··on No Sane Compiler Would Optimize Atomics
The latest on consume: http://wg21.link/p0190r0

The spec is pretty sound, but unimplemented because that's not how compilers work right now for the generality that consume wants. I think the above proposal is likely to work because it's more restrictive towards how consume works, but we need implementation experience.

Linux uses consume extensively for RCU, and I don't think it'll go away soon because of the benefits it provides to Power and ARM. It works through a gentleperson's agreement between Linux's RCU implementation in C and GCC.

jfbastien··on No Sane Compiler Would Optimize Atomics
> compiler started to introduce speculative writes on code pathes where the write did not occur in the source code, and this broke multithreaded programs

c.f. http://www.di.ens.fr/~zappa/readings/c11comp.pdf

> the position of "all the standard, nothing but the standard" is utter bullshit

I'm pretty sure that wasn't the point.

> the current published atomic specification is subtly unsound

Details? Batty has a few nits for C around memcpy, consume isn't implemented, out-of-thin-air is a theoretical problem, and forward progress guarantees will be added "soon". OTOH I can't think of anything else, but I'm sure I'm forgetting some. IMO none of these are interesting enough to be in the talk, but would make fine references.

> Do compiler authors do the right thing instead of trying to implement the broken spec, while waiting for the spec to be fixed?

Compiler authors are also fixing the spec.

> without proving this really improves performance like crazy to justify taking that kind of risk

That's untrue in most cases, especially when optimizing atomics.

jfbastien··on Experimental support for WebAssembly in V8
Done https://github.com/llvm-mirror/llvm/tree/master/lib/Target/W...
jfbastien··on Experimental support for WebAssembly in V8
The wasm AST is also a language, and a very simple one at that. Much easier to test and fuzz than all-out JS.
jfbastien··on Experimental support for WebAssembly in V8
JS isn't going anywhere. wasm and JS are a dynamic duo, complement each other.
← PreviousPage 2 of 3Next →