Introducing Solang: A Solidity Compiler for Solana

6 min read

Learn about the Solidity compiler for Solana, Solang with its features and significance.

Ethereum is a major blockchain with thousands of dApps deployed on it, but it's far from being the only chain. Today, several blockchain networks, including Polygon, Solana, and BNB Chain, among others, have gained popularity among traders for accessing exclusive tokens. These networks are equally valuable for developers who seek to leverage the unique features of each blockchain and build their projects on them.

Having said that, most blockchain developers are focused on Ethereum, and their language of choice for writing smart contracts is Solidity. This makes developing on multiple blockchains tricky. Solana is actively working to attract more developers and empower them with Solang, a technology that enables Solidity developers to write smart contracts for Solana blockchain without the need to learn an entirely new programming language.

Solana Overview#

Solana is a blockchain designed with the focus of DeFi apps in mind. It was launched in 2017 with a primary goal of providing fast transactions, low gas fees, and low energy consumption. It uses a delegated Proof of Stake consensus mechanism with Proof of History using hashed timestamps to confirm when transactions took place. At the time Solana launched, Ethereum was still Proof of Work, and the Proof of Stake mechanism of Solana appealed to many environmentally-conscious Web3 users and investors.

Today, Ethereum has also moved over to Proof of Stake, and there are numerous Layer 2 solutions offering low fees and high-speed transactions. In spite of this, Solana remains one of the popular choices for DeFi apps and NFT projects. There are hundreds of mature projects in the Solana ecosystem, and new ones are always on the way.

A major challenge for the Solana Foundation, however, is attracting Solidity developers to its ecosystem. Solana is a chain similar to Ethereum in terms of its ability to create dApps and carry out transactions. However, their underlying environment and working mechanisms differ, so Solidity doesn't work with Solana. This makes it difficult for developers who primarily work on Ethereum to deploy dApps to Solana.

Developers who want to write apps for Solana originally needed to know either Rust or C, with the option to write contracts in Python being added later. These languages are popular outside of the cryptocurrency space, but Ethereum uses Solidity, its own language that is perhaps most similar to Java. Developers whose first language is Solidity would find it difficult to switch over to Rust, for example, due to the different memory models and Rust not being an object-oriented language.

Solang is an attempt to address and fix this problem by enabling developers to write code in Solidity and compile it to run within the Solana ecosystem.

What Is Solang?#

Solang is a compiler for Solana and Polkadot that takes smart contracts written in Solidity and compiles it so that it can run natively in the Solana environment.

Using Solang, Ethereum developers can now write smart contracts in Solidity, the language they know best, and have those smart contracts run on Solana. This makes the Solana blockchain more accessible to developers who have previously been limited to writing only for EVM-compatible blockchains and Layer 2s.

The Solana Foundation anticipates that this will attract more developers to the Solana blockchain, either by having them develop applications for both ecosystems or by allowing them to migrate from Ethereum to Solana to take advantage of Solana-exclusive features.

Solang has a lot to offer developers:

  • Compatibility with Solidity compiler version 0.8
  • Can call other Solana smart contracts
  • Support for Solana SPL tokens and program-derived addresses
  • Enables development with Anchor
  • Build native Solana smart contracts and use Solana's native features

This isn't the first tool Solana has launched to attract developers. In 2022, the foundation launched Seahorse, adding the ability for developers to write Solana programs in Python.

Why Choose Solang?#

One of the key benefits of Solang is that it makes Solana development accessible to a much wider group of developers. Rust and C are both powerful programming languages; however, learning them would be a hassle for someone who is used to Solidity. These programming languages have a steep learning curve, especially for developers who first learned to code with an object-oriented language such as Solidity.

Low-level programming languages such as C and Rust are useful for programming tasks where the focus is on performance. The memory-safe features of Rust are useful and nudge developers towards writing robust code, preventing some of the workarounds or shortcuts coders might try with other languages. However, it’s not focused on optimizing the code for execution speed.

Solidity was developed with smart contracts in mind, and thanks to Ethereum's first-mover advantage in the Web3 space, it quickly became the popular programming language for DeFi and Web3 developers.

Rather than having developers learn a new approach to coding and a new set of tools, they can use Solang to port their existing dApps to Solana. They can explore and experiment with the new ecosystem and write new apps and smart contracts for Solana.

Now that Solana has support for Rust, C, Python, and Solidity, the blockchain is open to a much wider range of developers, from researchers and academics who grew up with Python to Ethereum-first coders looking to reach a wider audience with their applications.

Each of these options offers access to all of Solana's features, so developers are free to work with the languages and tools they know best.

Growing the DeFi Ecosystem#

Solana Labs’ launch of Solang in EthCC 2023 opened the possibility of developing even more powerful dApps by combining Solidity smart contracts with the exclusive features of the Solana Chain. Solana has made themselves accessible to a much wider audience, and we're excited to see what they'll do next.

It’s great to see so many projects dedicated to advancing the blockchain ecosystem with amazing innovations and announcements during the EthCC 2023 event. You can also check out other announcements that happened during the event, such as Arbitrum’s Stylus launchStarknet AppchainChainlink CCIP, and so on. You might also want to go through Vitalik’s take on Account Abstraction (AA), a technology that has the potential to attract a massive number of users to Web3.

Final Words#

At Neptune Mutual, we focus on making DeFi a safe space for traders, investors, developers, and day-to-day DeFi users. Our parametric cover protection ensures fast and reliable payouts for policyholders in case of exploits resulting in a loss of funds.

Be sure to check out our cover marketplace to explore the different cover protection products we offer on the chains EthereumArbitrum, and BNB Smart Chain. If you have a project and are looking to protect your community, get in touch with us. We’ll help you create a cover product in our marketplace to safeguard both your community and yourselves. We also offer many tools for users, devs, and project teams to navigate the industry completely for free; check out our Web3 tools and hacks database here.

By

Tags