4 ms·
What is the purpose of Solidity? Why did there need to be a new language for interacting with the Ethereum Virtual Machine? This really couldn't be accomplished
by yaitsyaboi 5y ago
What is the purpose of Solidity? Why did there need to be a new language for interacting with the Ethereum Virtual Machine? This really couldn't be accomplished by a python SDK?
- kamyarg 5y agoNot an expert in solidity but from my limited experience EVM and smart contracts have really different approach when it comes to computation. two things that come to my mind: - There is really no random() function due to need for determinism - Space vs. Time complexity is distorted, the gas you pay for instruction vs. byte is really different economics compared to AWS EC2 instance/hour etc.
- yaitsyaboi 5y agoInteresting, do you suggest any sources to read more about this?
- kamyarg 5y agoNot sure about articles but I can recommend Crypto Kittens Tutorial[1]. It has been some time since I did it(Late 2018 I think), but was really informative to get the mindset and different constraints people deal with in smart contract world. [1] https://www.cryptokitties.co/kitten-class/breeding/introduction https://www.cryptokitties.co/kitten-class/breeding/introduct...
- splintercell 5y agoSolidity is a DSL. DSLs have their purposes and this happened to be a correct purpose. It just also happens to be that Solidity is a terribly designed language.
- ZephyrBlu 5y agoIn what way is Solidity terribly designed?
- f00zz 5y agoNot an expert, but integer overflows getting silently truncated sounds pretty terrible. I understand there are safe arithmetic libraries, but overflow exceptions should have been built right into the VM
- meowface 5y agoI agree. Thankfully, this was fixed in Solidity version 0.8 (released December 2020). Arithmetic operations now automatically revert on overflow/underflow, unless the programer explicitly wraps them in an "unchecked" block (sort of like how Rust supports "unsafe" blocks).
- Paradigma11 5y agoIt's modelled after JS with the explicitly expressed intent to get web devs from JS to Solidity. And it worked.
- spiralx 5y agoExcept that it has all of the ergonomics of mid-2000s PHP and MySQL. Hah, this comment from a discussion here in 2017 also explicitly compares it to PHP of that era :) https://news.ycombinator.com/item?id=14691212 https://news.ycombinator.com/item?id=14691212
- gokhan 5y agoWhat's the benefit? These are all human errors, easily reproducible in any language.
- masklinn 5y agoSo none? Because I’d expect a langage custom built for smart contract to prevent or at least mitigate issues like mixing unrelated objects or never updating variables.
- RhodoGSA 5y agotldr; there is. Also, Gavin wood the writer of the Solidity programming language left etheruem and founded polkadot, writting substrate and ink in the process. Solidity is just a programming language to call functions and code on the blockchain. You can theoretically write it in any language but need to compile down to EVM at some point. Solidity wasn't writting from the ground up to be safe and secure. There are a number of projects like vyper, which is a pythonesque language that compiles to the EVM. It's more centered around safety.