Comparing Michelson and WebAssembly

@mootjes Thanks for the questions.

Although it’s called WebAssembly, a better name would probably be “UniversalBytecode” as it reach is well beyond the web and it’s too high level to call it actual assembly. This is also why multiple programming languages are interesting in supporting WebAssembly as a compilation target.

As multiple languages target and contribute to WebAssembly, this also makes it interesting to support WebAssembly as a smart contract runtime. The more people who can write smart contracts, the better. I expect that WebAssembly is more likely to get people outside of the Tezos community onboard, compared to Michelson.

However, I believe a good amount of skepticism is important and just implementing WebAssembly as-is in Tezos would be a bad idea. Running a classic application is definitely something different than running a “smart contract” application. Other blockchains have implemented WebAssembly as-is though, and I’m not a fan - as there is very little type safety due to the limited amount of supported types by default in WebAssembly. This is why I mentioned Reference Types in the post above. Also, I’m not sure if every feature should be supported from the start. Why would you want to manage a piece of memory for example if Michelson completely lacks this? A more conservative approach would have my preference. Unfortunately this approach has some downsides for supporting multiple languages, as those will probably expect certain features to be there.

If the Tezos community would decide to support WebAssembly, it would need to be at least be as good as Michelson. These posts are about exploring the idea of a WebAssembly runtime for Tezos, and I will try to make the best case for this.

1 Like