Michelson too complex?


To say this straightforward: I am not a Techie. However, I know quite a few of them. I know the Ethereum smart contract language Solidity and even I can somehow understand the essence when looking at some Solidity code as it is very simple. This simplicity might come at a certain price (error prone, e.g. DAO case). I gave some Michelson code examples to my Techie friends and they were quite puzzled: its pretty complex similar to the bitcoin script. While I understand that Michelson needs to comply with high standards, wouldnt it be possible to build a much easier language in top of Michelson?




Michelson is not too complex, it’s too low level for human beings. It’s intended to be a compilation target. It should be compared to EVM, not Solidity. Unfortunately, DLS and the Foundation’s communication about this is very weak IMO (and even counter-productive, showing many example of human-written Michelson code), and too many people still believe you’re supposed to think and write in Michelson.

I’m not even sure that Michelson is such a great compilation target, I haven’t read much about the considerations that drove its design, beyond the uncontroversial idea that you want some form of static type-checking even at the VM level. But if the voting and protocol upgrade system work properly, it’s certainly fixable.

1 Like

To weigh in, I think Michelson is good and bad. As the one who probably wrote many of the examples you’re talking about, I can say that writing Michelson code is harder than most of the other languages I use regularly, but it is 100% doable. The difference is that the language is in a different paradigm from those that you or your friends are familiar. The same would be at least partially true if Michelson was a logic language or a probabilistic language.

Michelson is designed to be a readable bytecode. One of the great advantages of Michelson over the EVM is that it is possible for you to read and understand a compiled program without access to the original source. The language is also small and simple enough that, should you not trust the tools built by the Tezos team or community, you could build your own and verify the contents of a program. Furthermore, should you not trust any of the existing compilers, you can write your own without too much difficulty. I personally trust the foundation, the dev team, and the compiler writers to write code that is, to the best of their knowledge, bug free, however I like that I don’t have to.

I agree with the above points that Michelson is not meant to be written by people. Some of the contract’s I’ve written took hours where in a higher-level language they would have only taken minutes. That being said, I do think that Michelson is a good language to learn. Doing so has improved the way I think about programs and programming languages.