Live data from Hacker News

Build Your First Thing with WebAssembly

cultureofdevelopment.com

31–40 of 58 posts

Re: Build Your First Thing with WebAssembly

#31
post #7

On one hand, I want to bash WebAssembly because it takes away our ability to see what we're running on our own PCs. On the other, it helps us slowly get away from the mess that is modern JavaScript.

Totally agree. I really think it's important for the community that there be a easy, free, and open way to view the source code (or some readable not obfuscated version) of any site.

Yes, definitely use source maps in all of your JS.

Re: Build Your First Thing with WebAssembly

#33

I suspect webassembly will fail miserably. If it succeeds anywhere it will be for gaming applications. I could be totally wrong, but most web developers who build applications and sites will not be likely to embrace this given the leverage JS provides and the simplicity of use. Again, I am not extremely against wasm, but this writeup is pretty well done and my take away was that it was non-trivial to pickup, buggy an…

I suspect wasm is a long-term bet on the part of web advocates (including Google and individuals like Eich) to ensure the web remains center stage in the age of mobile native apps that sit on top pretty powerful mobile hardware. As I understand, it's essentially asm.js repackaged in a more formal, standardized manner and has already gained support from all the major browser vendors.

Once integrated properly in desktop and mobile browsers (maybe two years from now), it would probably reduce most of the "useful" performance lead that native apps have over web apps. But, it's still a bet - because of course, no one really knows for sure what things will look like two years from now.

Re: Build Your First Thing with WebAssembly

#34
I still see a lot of misunderstanding here about what WebAssembly is. It's not really a "bytecode" like JVM's. The best simplest way to describe it is a virtual ISA for compilers to target.

So the languages that make use of it will be compiled languages like C, C++, Pascal, Fortran etc.

Re: Build Your First Thing with WebAssembly

#35
post #23

Earlier quoted context omitted.

That's fair. Originally asm.js was named capsule.js but that was taken and didn't really mean what it was. We could also call it modules but there is another very related spec out there for that as well. What would you call it instead?

OpenDoc used 'part'. IIRC, all parts had a presence in the GUI, though. This, I think is just a library or archive (in the ar/ranlib sense; https://sourceware.org/binutils/docs/binutils/ar.html#ar ) of code that the browser loads over the Internet. Java hit a jackpot calling such a thing a jar, a word that is both shorthand for "Java archive" and a noun describing a container. That suggests looking at words such as '…

Plus jug will give us great opportunities for immaturity, like hey Bob, can you take a look at my jugs? Are my jugs too big?

Re: Build Your First Thing with WebAssembly

#36

I suspect webassembly will fail miserably. If it succeeds anywhere it will be for gaming applications. I could be totally wrong, but most web developers who build applications and sites will not be likely to embrace this given the leverage JS provides and the simplicity of use. Again, I am not extremely against wasm, but this writeup is pretty well done and my take away was that it was non-trivial to pickup, buggy an…

> I am curious who web assembly is for and who is really excited about it.

In particular, I'm curious what web assembly is supposed to be offering that Java applets didn't.

Re: Build Your First Thing with WebAssembly

#37

I suspect webassembly will fail miserably. If it succeeds anywhere it will be for gaming applications. I could be totally wrong, but most web developers who build applications and sites will not be likely to embrace this given the leverage JS provides and the simplicity of use. Again, I am not extremely against wasm, but this writeup is pretty well done and my take away was that it was non-trivial to pickup, buggy an…

Speaking as a front-end-heavy developer (but someone who knows quite a lot about the back end too), the ideal of WebAssembly definitely excites, but the bridge to actually engaging with the technology is too cumbersome to actually do anything with it yet.

My take is two-fold. First, the tooling needs to mature. Second, a community of more hard-core developers (i.e., those who work regularly with C, C#, C++, etc.) needs to crop up.

Without those two things, I think you're right, it will never take off. But my bet is that both of those things happen; larger companies will at some point bank on it, and throw a bunch of tooling and development resources at it. Just a guess.

Re: Build Your First Thing with WebAssembly

#38

Earlier quoted context omitted.

That's fair. Originally asm.js was named capsule.js but that was taken and didn't really mean what it was. We could also call it modules but there is another very related spec out there for that as well. What would you call it instead?

It's interesting that the discussion in this thread centers around what to call modules, components, and packaging units. It's like saying that JVM bytecode is a way to author JARs, when it's actually the other way around: JARs are a way to package classes packaging JVM bytecode, which is a compilation target for various languages. WASM is similarly a compilation target for code; whether it's a module of code or a ca…

Initially my thought was to compare it to the first compiler, back in the days when punch cards were the interface, but I decided against any history lessons that go that far back. In that analogy, the byte code is the machine, and now we all need to be writing compilers for it. This is why so many languages compile to javascript, it's the assembly of the web (not my trademark), in the browser world at least. If you want this code to run in that browser, you gotta pay the penalty of cross compilation inefficiency.

I actually think being browser agnostic is more important; it is sort of the reason we're even looking at wasm replacing asm.js in the first place. asm.js is still javascript, even though it gets handled differently under the covers. Having a second option of language supported by all major browsers is a huge deal, especially one with static typing.

As for the naming thing, a little bit of bikeshedding is healthy from time to time.

Re: Build Your First Thing with WebAssembly

#39
post #30

Earlier quoted context omitted.

That's fair. Originally asm.js was named capsule.js but that was taken and didn't really mean what it was. We could also call it modules but there is another very related spec out there for that as well. What would you call it instead?

We've been calling them modules, but I'm not certain that's what we'll end up with. Also, there's a reason the description is a bit fuzzy on the WebAssembly landing page. It's not just a binary format (in fact, we didn't have a binary format for a while after we started). I like to think that it's a specification of execution semantics that can be expressed in many different formats (text, binary, AST, etc.). Not sur…

Sounds like a processor to me, let's just call them kernels.

Re: Build Your First Thing with WebAssembly

#40
post #28

Earlier quoted context omitted.

I had the exact same problem when I first started. Someone once told me "what we can throw away to solve this problem", so I kept removing parts until I got here which I think is currently the easiest way to get started.

Ultimately you should be able to use your C compiler and generate wasm files directly, rather than go through asm.js. There is an experimental backend of LLVM that you can try, but it will require building LLVM from source currently. Emscripten has an option to do this automatically, I believe. You can also write the AST format by hand, which IMO is much easier to do than writing asm.js by hand, just more verbose. I…

I'm familiar with the LLVM direct to wasm tool, but I was unable to get it working using the steps from the emscripten docs. The binaryen toolchain is pretty easy to digest, but I've been using the emsdk almost exclusively for the convenience. Once you have to rework part of it from source, I just don't know enough about it to debug it yet.

Thanks for the info on where to find outstanding proposals.

Post reply on HN