EOS first look at the source code: WebAssembly
I saw a lot of good and bad stuff about EOS. I am not interested in about all the noise so I started to look at the source code provided on github https://github.com/EOSIO/eos to dig further on the technical side.
First, I am having a look at the library dependencies: https://github.com/EOSIO/eos/tree/master/libraries
I will just say my thinking about the technical choice for WebAssembly (http://webassembly.org).
What is it ?
WebAssembly aims at building a standard for a portable "assembly code" that is then compiled natively for web or non-web application.
Check out this video to know more:
Why does it matters ?
EOS needs to execute the code of your application stored on its blockchain and you want to be super efficient/fast and portable accross platforms.
More important, you do no want to recreate the wheel for this component: writting a good, robust and performant compiler is not something that you can tackle in 12 months, even with tens of people. The current implementation of the WebAssembly backend uses the well-known LLVM (http://www.llvm.org) which is one of the most active compiler infrastructure.
https://github.com/WebAssembly/binaryen
https://github.com/AndrewScheidecker/WAVM
For the time being the compiler only works for C++, but it aims at covering more languages in the future. So basically, it will come at a low cost for the EOS Team to allow to write smart contracts/applications with more languages in the future.
My thoughts:
Using WebAssembly is a pragmatic good choice:
- For the short term, EOS developpers have not to deal a lot with compilation/performance and they can focus on what really matters for them.
- For the long term, this technology is sound, good, evolving, going to mature very soon, and many important actors are working on this and putting a lot of money: Google, Apple, Microsoft, Unity3D ...
- Creating an API for smart contracts/application on top of C++ is a better choice than creating yet another new language: no compiler, no vm, an API is simpler to maintain and to modify.
Believe that WASM is the first 'standards'based' that began with Microsoft/Google/Apple/Mozilla working together at initiation. PWAs get higher performance with WASM and JavaScript as compared to JS alone.
Getting started with WASM isn't very hard. Do not need dedicated VMs or a bunch of tools or difficult build-chain.
Yes, true. The code size reduction obtained from WASM versus JS will help also for PWAs, probably less memory usage versus regular JS. Also, the possibility to port easily Desktop apps (Qt5 for instance: http://qtandeverything.blogspot.lu/2017/06/qt-for-web-assembly.html), really interesting stuff coming on.