Solidity, King of the Castle
Ethereum smart contract developers are familiar with the Solidity programming language, but many have not tried Vyper. Vyper is a pythonic (similar syntax to Python) smart contract language for the Ethereum Virtual Machine (EVM). Vyper prioritizes security, readability, and encouraged simplicity to aid code audits.
Solidity is the most popular smart contract language, and it has the most developer attention. Solidity offers the richest EVM feature-set and is the default choice for most smart contract developers.
Vyper, the Scrappy Underdog
However, Vyper is catching up!
A common objection to using Vyper for smart contract development was the lack of dynamic arrays. A dynamic array is a simple data structure that can be initialized and grow in size to hold as many elements as needed. Solidity offers a lot of flexibility in this regard, but an array having no upper limit creates a potential security risk.
Vyper was originally provided with fixed array support, but the developer team recently merged a set of patches that provide dynamic array support into the master branch on GitHub.
Key Vyper developer señor doggo posted to Twitter about the news last week, asking for bug reports and testing from smart contract developers.
The Vyper developers plan to include this feature in the upcoming version 0.3.2 release.
Who Cares about Dynamic Arrays?
Solidity and Vyper are high-level languages, which means they prioritize syntax that is easy for humans to read and write. More flexibility allows programmers to express their creativity.
A smart contract cannot easily be changed after it has been deployed to the blockchain, so a programmer must choose between a large fixed-length array or a dynamic length array at the start. Solidity offers dynamic arrays that grow as needed, so they are popular. The more flexible option is often better.
Developer Response
The Curve team posted a very helpful writeup on Substack the next day, describing key reasons why dynamic arrays are critical for Vyper. Among them, dynamic arrays are needed to support the creation of ERC-1155 tokens (a kind of NFT).
Both Solidity and Vyper smart contracts are compiled to EVM bytecode, so Vyper closing the feature gap between it and Solidity allows for more talent to enter the space.
Vyper is used extensively by Yearn Finance and Curve Finance, both well-regarded DeFi projects with a focus on security.
Yearn developer Banteg often posts to Twitter about battling smart contracts without having access to dynamic arrays. Perhaps we’ll see a little less devposting and a little more hentai?