Live data from Hacker News

Compiling to WebAssembly: It’s Happening

hacks.mozilla.org

101–110 of 225 posts

Re: Compiling to WebAssembly: It’s Happening

#101

Earlier quoted context omitted.

In the current proposal there is no way for WebAssembly to directly access the DOM (or any other "Web API" objects). Basically you will need to drop back down into javascript and handle that there (basically how asm.js does it now). But there is a proposal to eventually integrate direct DOM access into Web Assembly, but that's for after they get it up and running.

If they wanted to do it right, then an HTTP requests itself should serve a compiled HTML binary based on an AST. The binary version of HTML.

If you are using the XHTML syntax, you could send it in a binary XML format such as Efficient XML Interchange (EXI). (Never seen anyone actually do this of course, since browsers don't support it; not sure if it is a good idea either - would it really be much faster than just say GZIP, sufficiently so to justify the extra complexity?)

Re: Compiling to WebAssembly: It’s Happening

#102
post #6

Earlier quoted context omitted.

The important use case is to allow people to write web applications with their language of choice, instead of horrible javascript. And get near full performance.

Sorry to say, but the web isn't about writing apps in the language of your choice. If it's beyond plain, passive HTML, it's about running applications on foreign hosts/resources without a well specified license to do so. Scripting languages provide both audible code and a small load as compared to binary object code (which is, why we had them on servers and clients in the first place). If we turn the web into an anyt…

Why are you under the impression there won't be disassemblers and decompilers for WebAssembly?

It's not like a bunch of minified JS is going to be "quick" to go through.

Re: Compiling to WebAssembly: It’s Happening

#103
post #80
post #38

Earlier quoted context omitted.

Do you really read other people's minified/obfuscated js?

It was far less common to minify JS code when I started doing that, but yeah, even now I much rather have minified JS code than no code at all.

So decompile or disassemble WebAssembly?

Re: Compiling to WebAssembly: It’s Happening

#104
post #3

Web assembly always makes me a little sad. It feels like we are going back to flash only it won't be bad this time, I promise, no really. I always feel like the most obvious use for it is to start writing truly hateful and abusive code. I'm sure this is because I'm getting old.

We will eventually come to terms with the fact that Flash was 15 years ahead of everything else on multiple fronts and we ought to have been just chastised the terrible developers doing awful and horrendous things with pretty technically sound software.

How would that have fixed Flash’s horrible CPU cost, chronic security vulnerabilities, awful touch support, or constant prone to crashing, even in the hands of competent developers?

Re: Compiling to WebAssembly: It’s Happening

#105
post #6

Earlier quoted context omitted.

The important use case is to allow people to write web applications with their language of choice, instead of horrible javascript. And get near full performance.

I can't believe people still bash JavaScript. I've used a lot of different languages including Java, C#, C++, AVR Assembly, Python and others but JavaScript is my favourite and I would not want to go back. I think its a shame that some people just didn't seriously try JavaScript. It's a very powerful, expressive language. Also, testing with JS is amazing - Especially unit testing on Node.js. It lets you do stuff like…

It's not a bad language, but it's not good either. But who is it powerfull? It's a very poor man's scheme, and scheme is not powerfull either. If javascript has anything to over it's IMO simplity and not power.

But I'll never understand who thought this asynchronous API was a good idea.

I just wanted to draw pictures in a canvas _in order_, because they should overlap. A common task you could mean. I ended up building a monadic builder for callback chains, that creates a javascript string that is evaled. I felt like this language and the api was incredibly cumbersome, minimalistic and limited. It lacks a blocking api, monad support, dsl support, macros and lazy evalution.

But mayme there is a simple solution to that, that I'm not aware of.

Re: Compiling to WebAssembly: It’s Happening

#106
post #6

Earlier quoted context omitted.

The important use case is to allow people to write web applications with their language of choice, instead of horrible javascript. And get near full performance.

I can't believe people still bash JavaScript. I've used a lot of different languages including Java, C#, C++, AVR Assembly, Python and others but JavaScript is my favourite and I would not want to go back. I think its a shame that some people just didn't seriously try JavaScript. It's a very powerful, expressive language. Also, testing with JS is amazing - Especially unit testing on Node.js. It lets you do stuff like…

[deleted]

Re: Compiling to WebAssembly: It’s Happening

#107
post #95

Earlier quoted context omitted.

If type safety is what you miss, why not to use some transpiler like TypeScript? http://www.typescriptlang.org/Tutorial

Then you're not writing JavaScript, which was OP's concern. TypeScript is fine (although Elm, Swift, and Haskell are more interesting, IMO).

Look at purescript. In order to install this madness you need to install not less than 5 package managers, but you might like it.

Re: Compiling to WebAssembly: It’s Happening

#108
post #95

Earlier quoted context omitted.

If type safety is what you miss, why not to use some transpiler like TypeScript? http://www.typescriptlang.org/Tutorial

Then you're not writing JavaScript, which was OP's concern. TypeScript is fine (although Elm, Swift, and Haskell are more interesting, IMO).

[deleted]

Re: Compiling to WebAssembly: It’s Happening

#109

Earlier quoted context omitted.

What makes WebAssembly like Flash? Please elaborate. You already can't just read someone's JavaScript code if they're using a transpiler or uglify or something like that, it looks like line noise and you basically have to go through a lot of work to reverse engineer it. WebAssembly is no worse. The JavaScript environment on the web reminds me of the "walled gardens" that were Lisp machines back in the day, that force…

> What makes WebAssembly like Flash? Please elaborate. It's pretty straightforward. Both tend towards the Big Binary Blackbox Blob. It's true that WebAssembly has advantages Flash, Java, and Silverlight didn't really have in terms of being freely reimplimentable and (potentially) native to the browser. And it's probably a good thing that a browser can be a VM via a target-intended subset of JS. BBBB may be the right…

> they break the benefits of view source.

The benefits are not that great these days. At least not for people who don't support a web ad monetization model or have no interest in being on the VC boat to float model.

Re: Compiling to WebAssembly: It’s Happening

#110
post #31

In the recent press tour about Swift, Apple seems to be really gung-ho about people using Swift everywhere. Since Swift is built on LLVM and there's direct LLVM support for WebAssembly, I wonder if Apple will get behind WebAssembly so they can get Swift in the browser.

If I'm not mistaken Webkit is implementing experimental WebAssembly support. It appears to be the only implementation being worked on upstream out of all the major browser engines right now.
Post reply on HN