Blockchain Semantics Insights
Business Case | Deep Tech | Announcements | Blockchain Glossary |
What is Solidity for Ethereum Blockchain?Aug. 1, 2018, 2:02 p.m. GMT
Compared to the other Ethereum Blockchain languages which compile on the EVM, Solidity contains a number of important advantages:
- Complex member variables for contracts are supported. For example, hierarchical mappings and structures.
- Contracts support inheritance, including multiple inheritances.
- An Application Binary Interface (ABI) facilitating multiple type-safe functions within a single contract is supported in Solidity. Type safety means that the compiler will validate datatypes while compiling, and throw an error if you try to assign the wrong datatype to a variable. This feature is now supported by the Serpent as well.
An Application Binary Interface (ABI) is the interface between two Ethereum Blockchain program modules, one of which is often at the level of machine code. The interface is the de facto method for encoding/decoding data into/out of the machine code.
Limitations of Solidity
Since the programs that we make on Solidity and similar languages for making smart contracts are transactions, they come with their own set of limitations. Some of them are as follows:
- A standard library hasn’t really been developed yet. Arrays and strings are especially difficult. For example, we need to write algorithms for even simple tasks like converting a string to lowercase. We never had to even think about these tasks in other languages/platforms.
- We cannot get data from outside the Ethereum Blockchain unless it gets in via a transaction. Data from outside the blockchain means any data from the real world such as say, the current price of gold, cricket scores etc.
Interaction with such data is done using an oracle, details of which will be discussed later.
- Once a contract is deployed it is not upgradable. We can plan for migrations or pure storage contracts, though.
Some of these limitations are needed for the existence of the Ethereum computing platform. For example, we will never be able to store a backup of your Google Photos and perform image recognition purely on-chain, and that is just fine. Other limitations are here just because it is a really young technology. It is evolving blazingly fast though and it will keep improving over time.
That being said, it is very possible to build interesting projects on top of Ethereum Blockchain today.
To learn how to write smart contract and develop a DApp on Ethereum Blockchain using solidity, visit Blockchain Semantics Ethereum Developer Certification.