The Countdown to Blast Off is on! 
Join the 400M $SUPRA token airdrop
Robot Image
Supra

Blockchain Programming Languages for Ambitious Web3 Developers

January 01, 2022 - 12 min read

Choosing which languages to learn can cause stress as developers want to find meaningful work and want their dApps on the most relevant blockchains.

blockchain and web3 programming-languages

Web3 is characterized by network decentralization in which digital ownership is recorded on distributed ledgers, ushering in a new age for the Internet: an age of trustlessness. Entities across the globe can now safely and transparently transact with each other without the need for trust as they know that their assets are held safe and immutable on blockchain ledgers.  

Intermediaries won’t be necessary for two parties to transact with each other because there won’t be a need for any “trust” between them. However, a trustless world cannot become reality until the globe’s best developers understand key programming languages and start building the Web3 world from the ground up. 

Fortunately, developers are hearing the call to action and are flocking to Web3 in droves. In 2021, more developers than ever joined Web3, with over 34,000 joining the industry throughout the year. Mirroring the situation in the traditional finance world, “crypto” job hirings are likewise at all-time highs. This paradigm shift is happening faster than the news can get out, resulting in high numbers of related job openings as well as increased higher pay, bonuses, or other remunerations like token allocations.

banks crypto hires increased in past 5 years
It appears that major hiring decisions followed the 2017 price spike of Bitcoin, continuing to rise throughout the Covid-19 pandemic, and remaining constant ever since.

Developers these days have learned to use a number of popular languages like Python, C++, Truffle, Javascript, Golang, Solidity, Rust, and many others. Those trained in the most contemporary languages will find the transition from Web 2.0 to Web3 dApp development easier to manage. 

For example, smart contract languages like Solidity were designed to be an easy bridge for programmers already familiar with contemporary programming languages used by the biggest names in tech today. Platforms such as the Ethereum Virtual Machine (EVM) allow for the development of Ethereum-compatible dApps with various implementations written in languages like Go, Python, Parity, Haskell, etc.  

Languages like Rust and Haskell are also gaining prominence, making them relevant for developers to consider using to deploy their dApps on other blockchains with attributes like higher throughput capabilities, time to finality, or network decentralization and consensus methods. Therefore, an overview of some of the top Web3 languages may cast a light on what an aspiring Web3 developer can do to gain early advantages to build dApps in an evolving space

The most popular blockchain choice for developers is currently Ethereum, though there are others like Cardano, Solana, Avalanche, Tezos, and many more gaining traction among new and experienced developers alike. These blockchains are written in various languages, meaning there are work opportunities for devs no matter which language they know, though joining a larger dev community has certain advantages like educational material, compatibility libraries, and other plug and play opportunities for porting dApps.   

Learning a new programming language is a crucial decision for developers as it involves a significant investment of their time. Moreover, learning one language instead of another inevitably includes a wager on the chosen language’s growth in popularity and adoption. The best hedge is to become at least familiar with multiple coding languages.

That doesn’t mean one should delay the decision to learn too long, but developers entering the industry need to choose wisely. With a more active community comes more resources, employment opportunities, and end-retail users of one’s dApps. 

This brief summary should give some insights as to where most of the development has been and is going, what other developers are learning, what they want to learn, and what new developers can do to prepare for entering Web3 development. First, Javascript and Solidity are discussed with regards to their uses on Ethereum, then Haskell and its basis for Cardano’s native Plutus language, as well as Rust, notably used by Solana, NEAR protocol, and Polkadot.

Javascript & Solidity: Speaking Ethereum

As an object-oriented language, Javascript (JS) and Solidity share several similarities, but their functionality can hardly be compared. JS has, of course, been used for web development for some time already, as the code adds interactivity to a web display. 

That is, it is primarily front-end code which ‘displays’ backend systems data. While JS’s predecessors, CSS and HTML, focused primarily on displaying content, JS has brought the web to life with dynamic user experiences and impressive functionality. 

Just as with web pages and mobile applications, JS can be used to create dApps in Web3 development. As previously mentioned, all of the existing features of web development are used to structure and style Web3 dApps, but when it comes to dApps, there are some key differences to note. 

For instance, developers need to know how to use the ‘Web3.js’ library, a collection of libraries that allow users to interact with both local or remote Ethereum nodes using HTTP, IPC or WebSocket. This allows developers to implement plug-and-play tools to make their dApps compatible with Ethereum’s standards.

most loved blockchain languages
Going by the numbers, learning Rust, Kotlin, Haskell, and Go would equip a developer with an uncommon and desirable skill set. Source: HackerEarth 2021 Developer Survey

Solidity, as mentioned, is easier to learn than other Web3 languages since it was designed by programmers familiar with languages already being used in Web 2.0. It is the smart contracts language used by Ethereum developers, but its code only takes up a fraction of the total language used to run a given dApp. 

Other languages will do the heavy lifting in terms of the dApps look and functionality excluding the smart contracts themselves. Solidity can also be tricky in that internal state conditions might affect certain protocol behaviors, meaning the language can cause critical failures in certain contexts. 

Consequently, more rigorous stress-testing needs to be done before launch to avoid disaster. Due to the lack of uniformity with regards to the language’s functionality, critical mistakes might not be immediately obvious, hiding in plain sight before creating trouble down the road. 

To be fair, Solidity is a relatively young language, meaning the population of developers to identify bugs and other issues is smaller and has had less time to put in the collective work yet. The youth and size of Solidity’s community thus have a relatively smaller library of reusable behaviors and standards implementations in comparison with older languages, though this is quickly changing. 

Solidity’s community and its libraries have expanded even more rapidly since 2020, and developers have been eager to launch their dApps on Ethereum using Solidity to write their smart contracts. In Web3, Solidity has been the gold standard smart contracts language for several years, and only recently have alternatives begun gaining significant traction.  

Furthermore, the Ethereum blockchain is the largest player in DeFi and has a stronger network effect than any other smart contracts platform, boasting over 2,000 active developers working at the end of 2021. Learning Solidity has been a necessity for devs entering the Web3 space, and the industry’s mainstreaming process has only just begun. Ethereum consistently attracts 20-25% of new developers entering the Web3 space, with numbers trending upwards since 2017. 

With Ethereum 2.0 on the horizon, recently rebranded the consensus layer as it forks to a proof of stake consensus mechanism, there is a lot of upside to learning Solidity and pairing it with another language to create dApps on Ethereum’s massive network. Many developers looking to break into Web3 will find this to be the path of least resistance. 

Haskell: Pure Functional Web3 Programming

In the crypto world, Haskell is often associated with the Cardano blockchain, though the language is further compiled into a bespoke language called Plutus. Haskell is a general-purpose, functional programming language typically used in academia, research, and industrial implementations. 

As of 2021, Haskell makes up only a tiny minority of Web3 developers and is not yet widely understood by many developers. The community of Haskell developers is, however, growing steadily in size and activity, with thousands of open-source libraries and other developer tools available at the online repository Hackage

Functional programming has advantages in machine learning, parallel programming, and big databases. The code is precise, with a heavy emphasis on stable infrastructures through short and clear code, and pure functions which are more readily subjected to testing and debugging processes. 

Moreover, it uses lazy evaluation, meaning that programs run faster due to any irrelevant code being bypassed unless strictly necessary. It’s also quite useful for developers as it makes use of Automatic Memory Management (AMM), meaning developers need not write memory management tasks into the code when developing their dApps. 

Moreover, Haskell emphasizes “pure” code, meaning that a given line of code will behave in a predictable manner despite any other confounding factors within a program. That is, the language is simpler to test and prove its correctness. Just as with Rust, developers writing in Haskell may enjoy a higher degree of confidence that their code is reliable and that bugs are caught quickly by the compiler. 

Nevertheless, Haskell is well known for being difficult to master for even experienced programmers. Thus, Haskell libraries and dev communities are likely to be more sparse as the language has a more difficult mastery threshold, thus leading to fewer developers and slower growth. Having said that, this could mean that the field of competition for Haskell developers makes it easier to stand out from the smaller crowd.

So Let’s ‘Go’ Then: Cosmos & Polygon SDKs

Go is an open-source, general programming language, developed by Google software developers and launched in 2009. It is an explicit, statically-typed language, modeled after the language C. In addition to adopting C’s syntax, input variable types are defined from compile time, meaning errors are found before program execution. 

Go is commonly used by both Cosmos and Polygon SDKs. It has tons of native libraries, and is compatible across platforms and even mobile devices. Further, it utilizes “Goroutines,” which helps dApps boot up quickly and perform tasks without consuming much memory. Go also runs multiple threads for efficient concurrent execution under heavy use.

As mentioned, Web3 examples of Go in action include Polygon Edge SDK, a modular framework for dApps and blockchains to build Ethereum-compatible networks. This bootstraps third-party networks to Ethereum’s blockchain, enabling the transfer of ERC-20 tokens and ERC-721 NFTs through their own bespoke bridging solution. Other implementations of Ethereum can be embedded into Go using the Go Ethereum client

The learning curve for Go is not very steep, as JS or C developers will find the beginning stages of learning Go play to their intuitions. There are tons of learning resources out there as well. Also, Go is rather well-loved, according to Stack Overflow’s 2020 developer survey, coming in at over 62% reporting they enjoyed the language enough to continue developing code in it.

On the other hand, learning Go might appear more popular since it is much simpler to pick up amongst beginners. Thus, Go’s simplicity could mean programmers working on larger projects will utilize additional languages like JS, Rust, Python, or C, for example.

Rust: Simplicity, Concurrency, & Time to Finality

Rust was first released in a stable form back in 2015 by a former Mozilla employee. It’s notable for its focus on better memory safety by using a compiler, more accessible concurrency, and zero-cost abstractions. The launch of Polkadot and its use of Rust has likely contributed to a sharp rise in job openings seeking Rust devs and numbers of developers learning Rust to meet that demand. 

Rust is easily portable, allows for functional programming, and is commonly used for development in the Solana ecosystem as well. Since its 2020 Launch, Solana has grown its developer base nearly 500% from around 180 to almost 1,000 active developers writing in Rust by the end of 2021. The Rust community is set to boom even more in the coming years. 

In 2020, a Stack Overflow survey of developers found that Rust was the most loved language among developers who tried it, with roughly 86% respondents saying they wanted to continue coding with Rust in the future. This indicates that Rust is attracting and keeping talent, meaning its use in Web3 should continue for some time. 

Furthermore, Rust works well in conjunction with other languages if needed, making it easy to invoke another language or vice versa. This lends to the notion that Rust could be a suitable language for the Internet of Things (IoT).  

Perhaps most notable about rust, as mentioned, is its Compiler. This pedantic feature eliminates a number of common bugs which commonly trouble developers in other languages. For instance, each step of the way, the compiler ‘checks’ the code for memory safety issues to ensure that hidden bugs do not lie dormant. Otherwise, they might create issues for the developer at an undefined point in the future. 

This eliminates a lot of the frustration of backtracking, not to mention provides a high level of confidence in moving forward on a project. It is also visually pleasing with color coded messages, showing error documentation inside of the terminal.

blockchain languages rust solana supraoracles polkadot
Rust is most suitable for high throughput, concurrent operations, and gives developers confidence that unexpected bugs won’t lie dormant only to cause issues down the road.

In addition, concurrent (and parallel) programming makes for lightning-fast transactions, since various computations can be done simultaneously to execute the code. This gives Rust programs incredible scalability as its throughput can handle more transactions per second (TPS) than other languages. 

This scalability in processing concurrent transactions is made possible by the use of futures, thread pools, and channels. These features seem to alleviate the congestion issues which have continued troubling Ethereum users as network usage skyrocketed over the years since its inception in 2015.  

Zero-cost abstractions have also become a core principle of Rust development. These abstractions are also advantages for developers using Rust, as abstractions take high-level, complex code and reduce it to its quickest and most efficient implementation

Essentially, it means that developers don’t need to spend as much time optimizing code as the compiler will compile the abstractions for them. The results are often that the application runs faster written in Rust compared with other languages, even if one spent time hand-optimizing the code in other languages.

Rust on the Rise

Since Web3 protocols require fast and robust performance in processing thousands of untrusted inputs, Rust seems to be the clear winner. It handles functionally complex tasks with lightning speeds, while also reducing bugs related to memory, bounds, null or initialized variables, or integer overflow

Though there is a learning curve, Rust’s compiler allows developers to focus heavily on logical correctness rather than the above issues. Using Rust should yield more robust dApps in that its use reduces so many common bugs by default, meaning dApps will behave as expected post-launch. 

Moreover, its concurrency capabilities are exactly what’s needed to handle tens or even hundreds of thousands of transactions per second, making Rust ideal for Web3 applications and eventually things like in-game transactions in the metaverse.  

On the other hand, choosing to learn Solidity offers a massive community and library of the Ethereum community. This sort of network effect certainly facilitates cooperation and the likelihood that a given dApp will get any use. 

The number of developer jobs in any language is likely to continue its upward trend regardless of language, especially for devs who know several. There will of course be fierce demand for developers familiar with Solidity, but learning Go, Haskell, or Rust may have advantages in that they are lesser known, making those developers even more desirable in employers’ eyes.  

One must consider how many crypto users holding ERC-20 tokens may even have ETH locked in staking for the indefinite 2.0 release, meaning many are committed to the ecosystem. Having said that, the future remains uncertain for the network as its major fork still looms large in the background, meaning time and capital invested might be better spent learning the next big language instead of the previous one.

References

  1. Electric Capital. (2022, 5 Jan.). Electric Capital developer report (2021). Electric Capital Developer Report.  
  2. Ethereum Foundation. (2021, 30 Nov.). Smart contract libraries. Ethereum Foundation. 
  3. Ethereum Foundation. (2022). The great renaming: What happened to Eth2? Ethereum Foundation Blog.
  4. Hackage. (2021). The Haskell package repository. Hackage. 
  5. HackerEarth. (2021). HackerEarth 2021 developer survey. HackerEarth Assessments.  
  6. Hosfelt, D. (2019, 28 Feb.). Implications of rewriting a browser component in Rust. Mozilla Hacks.  
  7. Lewkowicz, J. (2020, 29 May). Report: Rust is the most beloved programming language for five years running. Software Development Times. 
  8. Song, Z. J., & Doherty, K. (2021, 1 Nov.). Wall Street is offering big pay increases to amass a crypto army. Bloomberg Wealth. 
  9. Stack Overflow. (2020). 2020 developer survey. Stack Overflow Insights
  10. Web3.js Docs. (2016). Web3.js – Ethereum JavaScript API. Ethereum Revision a57dd3c5.

Related Articles

Learn More

twitterlinkedinfacebookmail

RECENT POSTS

Get news, insights, and more

Sign up for the Supra newsletter for company news, industry insights, and more. You’ll also be the first to know when we come out of stealth mode.

PrivacyTerms of UseWebsite Data Usage & CookiesBug DisclosureBiometric Information Privacy Policy

©2024 Supra | Entropy Foundation (Switzerland: CHE.383.364.961). All Rights Reserved