Programming languages used to write smart contracts?
I've heard that Ethereum based smart-contracts use Solidity to program the contracts. But, are there any other languages which are also used to program smart-contracts, and if not, is there any reason to believe why other languages couldn't be used to program smart contracts?
To post an answer, please !
1 answer
41 views
Solidity was written to target the Ethereum Virtual Machine (EVM), by presenting a language similar enough in style to C++ but more specific to EVM smart contracts. There isn't anything that prevents someone from making a different language for smart contract development in the Ethereum ecosystem. While the EVM, which is what actually runs the smart contract, can be programmed using the native assembly instructions, people tend not to do that because assembler is hard for most people in general.
This isn't just an Ethereum thing, but rather across the computer industry. C was originally created because assembler is hard, and C compiles down to the native instructions for whatever CPU you're using. Python eventually compiles down to native instructions. Java compiles down to the native instructions of the Java Virtual Machine. And so on.
On other blockchains, Solidity is only one of many options.
For QTUM, they're building an x86 compatible VM for smart contract execution. This means that it would be possible to use other existing programming tools that work on Intel computers, with some tweaking, for writing smart contract code. Solidity is currently supported though. Their goal is to support C++, Java, and Haskell.
For Solana, smart contracts are written in Rust, C and C++.
Not the answer you're looking for? Browse other questions tagged #Web3 #Smart Contracts or ask your own question.
@PipsquEECS#1658 answer is fabulous. But for all those who are not a dev or programmer:
Different languages are created for different purposes, some are more general others are more specific for certain application. Solidity was created to talk to Ethereum's unique architecture and features, but since then a lot of work has been done to allow common programming languages to interact with new and existing blockchains.