Am I the only one who feels like it's the end of the web as we knew it in the 90s and 00s, where you could open any web page, understand how it works and learn from it ?
Am I the only one who feels like it's the end of the web as we knew it in the 90s and 00s, where you could open any web page, understand how it works and learn from it ?
I hope that we'll come around to the idea that this two-decades long fascination with abusing the hell out of web technology was a fever dream, and go on to build something better on more substantial foundations.
I'm probably going to be disappointed...
My understanding (maybe wrong) was that this was going to be available in the browser.
In order to run the code in the browser, the code will have to be compiled to the binary format.
So where WAT comes in is your methods for producing WASM files now become one of the following:
Source in <otherlang> -> WAT -> WASM
Source in <otherlang> -> WASM
WAT -> WASM
So the human-readable WAT can either be used as a compile target for another language, which can easily be compiled into WASM, or you can write the WAT manually and compile it. Alternatively other languages might be able to compile directly to the binary format, skipping WAT representation entirely.
The translation between WAT and the binary format is lossless, so there's no advantage of producing WAT as an intermediate step.
It's also just as easy to get WASM from WAT as it is WAT from WASM. I don't know of any languages that compile to WAT and then compile to WASM; as far as I know 100% of languages compile directly to WASM.
Web browsers will/already show wasm disassembly when opened in the browser tools. A file can contain label metadata which makes it very readable.
As WASM gets adopted we'll see it get used in all sorts of places outside the browser. Many projects need a high-level scripting language and JavaScript will be the obvious choice.