4 ms·
They often forget to mention, that WebAssembly is just a low-level programming language (much lower than C), it has extremely simple syntax (it has just four da
by IvanK_net 9y ago
They often forget to mention, that WebAssembly is just a low-level programming language (much lower than C), it has extremely simple syntax (it has just four data types, no system calls, the specification takes 5 pages instead of 500 pages of C spec). You may call it a "bytecode", but typical bytecodes also have around-500-page specifications.
Also, its relation to javascript is not any bigger than the relation to any other programming language (i.e. there is no relation). A WebAssembly VM could be made as an extension of any environment.
I recommend reading the official paper https://github.com/WebAssembly/spec/blob/master/papers/pldi2017.pdf https://github.com/WebAssembly/spec/blob/master/papers/pldi2... (I learned more than about 50 "essays" that I read about WASM in the past).
- apo 9y agoReally helpful link. What's the current state of tooling to directly write WebAssembly? What assembler/editor/debugger you would you recommend?
- IvanK_net 9y agoRight now, "tooling" is quite the same as the tooling for Javascript. You can write your code in a Notepad and the web browser will tell you about errors. WebAssembly has two representations: a binary form .WASM and a text form .WAST (with one-to-one correspondence). The browser environment can convert between them (or you can write a short piece of code to do it). If you know C, this website may help you get familiar with WASM syntax: https://wasdk.github.io/WasmFiddle/ https://wasdk.github.io/WasmFiddle/ (when you press Build, the WASM code will appear at the bottom).
- paulddraper 9y agoAlso: WASM is best as a target for languages that usually committee to machine code. E.g. it's great for C, but not really for Python.
- moron4hire 9y agoMany languages--like Python--are implemented in C, so it's a pretty natural chain-of-events to get from there to WASM.
- deleted 9y ago[deleted]
- adrianratnapala 9y agoI think your claim is right, but be wary about spec page counts. They blow out with age. As time goes on, more pages are devoted to nailing down corner-cases, and retroactively legislating either for or against assumptions had previously been common sense until someone in the real world violated them. WASM will see such growth in time. Think of how simple HTML was once upon a time.
- derefr 9y agoHTML got complicated because they modified the assumptions whenever they were violated, to make the violation into a working case. Specs grow much more slowly if, in response to such non-conforming implementations of a processing stage, they just codify the common sense, and maybe give methods for detecting the non-conforming outputs and rejecting them. XHTML is not a large spec.
- adrianratnapala 9y agoVery true. But HTML is not unique in this regard, other standards have done this too. I picked on HTML because it is also a foundational web technology. Many of its standards setters are the same people who will influence WASM, and many of the same incentives will be at play with WASM as with HTML.
- binji 9y agoYou may want to take a look at the formal spec here as well: https://webassembly.github.io/spec/ https://webassembly.github.io/spec/ There's still some work to be done, but it is quite far along already.