Cointime

Download App
iOS & Android

Solidity vs Move vs Rust: The Evolution of Smart Contract Programming Languages

Validated Media

The security, speed, and developer activity of a blockchain are contingent on its underlying programming language and virtual machines. Two of the most popular programming languages are Solidity, used to build decentralized applications for the Ethereum Virtual Machine (EVM), and Rust for dApps on Solana.

However, since the latest emerging smart contract-based blockchains, Aptos and Sui, utilize Move as their foundation for a more secure and scalable layer 1, it’s only fitting to do a side-by-side comparison of all three.

Coding terminology

High-level languages (HLL)

HLLs are usually easier for developers to read and write in, as they more closely resemble human language compared to low-level languages which are closer to machine code. For a computer to read and execute the source code, it first needs to be compiled into machine language.

Low-level languages (LLL)

LLLs are more difficult for developers to read and write in, as they resemble machine code. As such, they can convert to machine code without an intermediate compiler or interpreter.

Runtime environment

On blockchains, virtual machines serve as the operating system runtime environment.

Interpreted or compiled programming languages

Programming languages distinguish themselves as interpreted or compiled languages.

A compiled programming language needs to be converted from the source code into executable bytecode.

An interpreted programming language, on the other hand, is being read and executed line by line at runtime by an interpreter.

As a result, interpreted languages are typically slower than compiled languages. However, interpreted languages are less prone to bugs, as the debugging of the code occurs at runtime and the intermediate compiled representation is removed.

In a compiled language, compiler bugs can occur even when the source code is flawless, so they are more prone to errors.

Sequential or parallel processing

Today, most major blockchains use sequential execution of transactions, meaning that the runtime environment can only process one transaction at a time. This is a major bottleneck for network throughput.

In contrast, some programming languages enable parallel processing (or parallel execution), allowing for much higher TPS compared to sequential processing without the need for mathematically driven solutions like zero-knowledge proofs.

Parallel execution identifies independent transactions to execute them concurrently. Dependent transactions, however, would affect the execution of another and therefore must be executed in sequence.

Solidity — the programming language for EVM smart contracts

Ethereum is the first programmable blockchain, which to this day remains the foundational development environment for the Web3 ecosystem growth. In order to program on Ethereum, you need to first create a “smart contract” by utilizing Solidity — a custom language specifically designed by Dr. Gavin Wood for smart contracts on Ethereum in 2014. The smart contract is then run on the Ethereum Virtual Machine (EVM).

As an HLL, Solidity makes software development more user-friendly. Additionally, Solidity is influenced by and similar to other popular languages such as C++, Java, and Python, making it easier for new developers to start developing in the EVM ecosystem.

However, as a compiled language, Solidity is more prone to bugs due to the additional steps necessary to translate it into machine-readable bytecode. As a result, and despite the extremely complex and costly audits that smart contracts undergo, we continue to see smart contract exploits in the Ethereum ecosystem.

Today, Solidity is an independent open-source project that is further refined and developed on GitHub. While it is not the only language that can be used to write code for Ethereum, Solidity’s syntax is specifically designed to target the EVM.

Advantages of Solidity

  • HLL and thus easier to learn and user-friendly
  • Abundance of good developer tools and open-source libraries
  • The most used language in Web3
  • Similar to languages like C++, Python, and JavaScript
  • Developers are less likely to make mistakes in languages they are already familiar with
  • Good community support
  • Existing standards (ERC20 and ERC 721)
  • Multichain compatibility (layer-two blockchains, sidechains and EVM-compatible layer-one blockchains)

Disadvantages of Solidity

  • As a compiled language, Solidity is more prone to exploitable bugs
  • Sequential processing is a bottleneck for network throughput

Solidity Adoption

At the time of writing, Solidity accounts for 87.45% of all total value locked in smart contracts, followed by Vyper (8.95%) and Rust (2.31%)

Rust — Solana’s primary programming languages

While many ecosystems are trying to attract new developers by being EVM compatible, Solana has taken a different path with its own unique programming language, which has seen impressive growth in adoption since launch.

Launched in 2011, Rust, unlike Solidity, was designed from the ground up as a general-purpose programming language and is not limited to smart contract programs.

Rust is a compiled, low-level and more complex programming language compared to Solidity. As such, it may be less attractive to new developers as it is more difficult to learn. However, many developers outside the Web3 ecosystem are already proficient with Rust, making it easier to start working on Solana or Near projects.

Rust is best known for being the primary programming language of Solana where it helps to achieve throughput that other blockchains can only dream of. For many, it is also a more powerful, versatile language compared to Solidity as it allows developers to manage memory effectively and leverage parallel processing.

Advantages of Rust

  • As a machine-oriented, compiled language, Rust offers high speed and good memory efficiency
  • Rust allows to achieve higher throughout with parallel processing
  • Rust achieves memory safety through the principle of ownership and borrowing, eliminating memory-related errors at compile time
  • As Rust developers are often more experienced developers, smart contracts (called programs) on Solana can be expected to be less prone to bugs

Disadvantages of Rust

  • As an LLL, Rust has a steep learning curve and is generally more difficult to learn
  • Program compilation for larger projects can take up to 10 minutes
  • Today, just a handful of blockchains support Rust, namely Solana and Near

Rust adoption

While blockchains using Solidity as their main programming language continue to have the largest share of active developers, Solana is currently seeing faster growth than Ethereum.

Move

Launched in 2019, Move is one of the most modern programming languages used in new layer-one chains like Aptos and Sui. Move is based on Rust, but was specifically designed by Meta for its Diem blockchain to solve the problems of existing smart contract languages.

As such, the team behind Move had the opportunity to examine the existing languages of the Web3 space and learn from their shortcoming.

Above all, Move is designed as an object-oriented language to write smart contracts or programs with safe resource management. Assets are defined as a “resource”, which can be moved between accounts, but which cannot be double-spent or duplicated.

This makes it very easy to write error-free code, in contrast to Solidity, where transfers of assets must be specified manually, increasing the likelihood of writing faulty code.

As such, Move eliminates the possibility of reentrancy attacks, which is one of the worst possible attacks on Solidity smart contracts.

As an interpreted language, Move’s performance is slower compared to compiled languages. However, the lack of a compiler and compiler bugs makes Move inherently more secure than Solidity.

In addition, Move inherits Rust’s memory efficiency and parallel processing, making it a solid choice for overall performance.

Advantages of Move

  • Like Rust, Move allows users to achieve higher throughput with parallel processing
  • As an interpreted language, Move doesn’t have a compiler, and as a result no compiler bugs
  • Move was designed with security in mind and aims to eliminate vulnerabilities such as reentrancy

Disadvantages of Move

  • New language with limited tooling, resources, and community
  • Harder to learn than a high-level language
  • Interpreted languages are generally weaker in performance than comparable compiled languages
  • No multichain compatibility as no major blockchain has adopted Move to date

Move Adoption

Aptos and Sui are currently the only blockchain projects using Move as their primary programming language and it is still too early to say how successful the language will be.

Conclusion

Solidity is the most popular programming language for blockchain development due to its user-friendliness and its widespread use on Ethereum. However, it has several vulnerabilities that have caused costly mistakes in the past. In contrast, Rust and Move are interesting alternatives due to their increased security and efficiency.

While Rust already offers better performance on Solana and shows impressive adoption, Move was designed to provide the most secure solution of the three, eliminating many of Solidity’s vulnerabilities.

It is important to remember that all three languages are relatively new. Potential security pitfalls are yet to be discovered and their long-term success remains to be seen.

While providing the foundation for smart contract development, programming languages are only one factor determining the speed and security of a blockchain and its dApps.

Comments

All Comments

Recommended for you

  • LayerZero co-founder: "Self-reporting of witch activities" is not aimed at individuals, but at industrial witch studios

    Bryan Pellegrino, co-founder and CEO of LayerZero, stated on social media that the "Self-Report Sybil Activity" is not targeting individual users, but rather large industrial witch farms (studios).Earlier, LayerZero Labs launched the "Self-Report Sybil Activity" plan, which allows witch addresses to self-report related addresses on a designated page and receive an expected allocation of 15%, without answering any questions. The deadline is May 17th, 19:59:59.

  • Argentina’s House of Representatives Passes Bill to Regularize Cryptocurrency Taxation

    The Argentine Chamber of Deputies has passed a cryptocurrency tax normalization bill aimed at advancing a series of important government reforms. The bill introduces the possibility of regularizing previously undeclared cryptocurrency assets, up to a maximum of $100,000, without paying government collection fees. However, if the value of cryptocurrency assets exceeds this limit, the government will apply preferential tax rates based on the taxpayer's declaration date.

  • GNUS on Fantom was attacked, with a loss of about $1.27 million

    According to Beosin's monitoring, GNUS on Fantom was attacked, resulting in a loss of approximately $1.27 million. GNUS stated on the X platform that due to recent vulnerabilities, hackers were able to mint fake GNUS tokens on Fantom, transfer them to Ethereum and Polygon through the Axelar Bridge, and sell them to existing liquidity pools. We will take a snapshot of the blocks before the exploit. To ensure fairness, please do not purchase GNUS tokens after the exploit, as we will issue new tokens.

  • Pandu Financial Group received the first round of strategic equity investment of tens of millions of Hong Kong dollars, led by Longling Capital

    Pando Financial Group announced it has received tens of millions of Hong Kong dollars in strategic equity investment led by Longling Investment. Pando Financial Group stated that it plans to use the newly injected funds for key growth areas, including market expansion, innovative product development, key talent recruitment, and technology upgrades, aiming to accelerate the layout of opportunities in the era of virtual assets through these strategic initiatives. Currently, the group's asset management scale has reached $500 million. Pando Asset, a subsidiary of Pando Financial Group, established its headquarters in Zurich in 2022 and issued the Pando 6 spot virtual asset fund (Bitcoin/Ethereum spot ETPs) on the Swiss Exchange. Another subsidiary of Pando Financial Group, Pando Limited, obtained licenses from the Securities and Futures Commission in Hong Kong, including Type 1 (securities trading), Type 4 (advising on securities), and Type 9 (asset management), as well as public fund qualifications, and was approved to manage investment portfolios with more than 10% invested in virtual assets and issued several excellent performance actively managed ETF products.

  • Hong Kong Monetary Authority launches industry consultation on “renaming virtual banks as licensed digital banks”

    Hong Kong virtual banks released their annual reports for 2023 last week. The eight virtual banks collectively lost about 2.99 billion yuan last year, a decrease of about 12% compared to the total loss of about 3.4 billion yuan in 2022. In response to the occasional feeling of "unreality" brought about by the term "virtual" in recent years, the Hong Kong Monetary Authority has initiated a consultation on renaming with the eight virtual banks, the Hong Kong Bankers Association, the Hong Kong Restricted Licensed Banks and Deposit-taking Companies Association, with the aim of renaming virtual banks as licensed digital banks, for a period of one month. It is reported that in the Asian region, similar banks have different names in different places. South Korea and Singapore issue licenses under the name of "digital bank", with Singapore further dividing them into digital full banks (DFB) and digital wholesale banks (DWB).

  • Chairman of the Russian State Duma Financial Market Committee: I do not support a complete ban on the circulation of cryptocurrencies in Russia

    Anton Gorelkin, Chairman of the Financial Market Committee of the Russian State Duma, said that he does not support a complete ban on the circulation of cryptocurrency in Russia. He explained in a post on Telegram that this restriction is not intended to ban the use of all cryptocurrencies, but rather to regulate the establishment of cryptocurrency exchange platforms within the legal framework of Russia. Anton Gorelkin also believes that the establishment of a legitimate cryptocurrency infrastructure in Russia is influenced by geopolitical realities, and this requires consideration of factors related to international relations. He further added that allowing such infrastructure may expose Russian companies to Western sanctions. In addition, Anton Gorelkin pointed out that this restriction may be lifted in the future, and users can still use foreign cryptocurrency exchanges and over-the-counter trading services as before. However, the impact on many over-the-counter cryptocurrency services in Moscow is still uncertain.

  • Ethereum L2 TVL is $39.98 billion, of which Base TVL is $5.57 billion

    According to L2BEAT data, the current Ethereum Layer2 TVL is $39.98 billion, with a 7-day increase of 0.69%. The top five TVLs are:

  • Hong Kong Exchanges and Clearing Limited: The total market value of Bitcoin and Ethereum futures ETFs reached HK$1.2 billion in the first quarter, with an inflow of HK$592 million

    According to data disclosed by Brian Roberts, head of securities product development at the Hong Kong Stock Exchange, shows that after the approval of virtual asset futures ETFs for public offering in Hong Kong by the China Securities Regulatory Commission on October 31, 2022, three virtual asset futures ETFs investing in Bitcoin and Ethereum futures were listed on the Hong Kong Stock Exchange. Since their launch, these ETFs have been popular with investors and have a high trading volume. The daily trading volume has increased from HKD 8.9 million in 2023 to HKD 51.3 million in the first quarter of 2024, and they have also attracted HKD 529 million in capital inflows. As of the end of March 2024, the total market value has reached HKD 1.2 billion, an annual increase of 255%.

  • Blockchain Asset Management announces launch of a dedicated blockchain fund for accredited investors

    Blockchain Asset Management, a cryptocurrency fund with a scale of $100 million, announced the launch of an exclusive blockchain fund for qualified investors. The specific amount of funds raised by the fund has not been disclosed yet, but it is said to have reached "eight figures", which means it is in the tens of millions of dollars. In addition, the investment threshold for the new fund is $100,000, and all investors are required to meet the approved standards (annual income exceeding $200,000, net assets exceeding $1 million).

  • Shanghai Municipal Party Committee Secretary: Welcome Standard Chartered to establish more new institutions, new businesses and new platforms such as blockchain in Shanghai

    Chen Jinong, the Secretary of the Shanghai Municipal Party Committee, met with Weihao Si, the Chairman of the Board of Directors of Standard Chartered Bank, and Mark William D'Arcy, the Executive Director, and some members of the Board of Directors yesterday morning. Chen Jinong stated that he welcomes Standard Chartered Bank to leverage its own advantages, strengthen strategic connections, place more new institutions, businesses, and platforms such as wealth management and blockchain in Shanghai, focus on deepening pragmatic cooperation in technology finance, green finance, digital finance, and create more application scenarios, and provide comprehensive and professional service support for enterprises to go abroad.