Announcing EVM-LLVM Alpha release — The next level in smart contract evolution!

Stevan Lohja
etc_core
Published in
4 min readFeb 10, 2020

--

Announcing EVM-LLVM project alpha release! This has been a long-awaited release for the EthereumStack communities as it will play a fundamental milestone in the evolution of smart contract development. The EVM-LLVM brings LLVM infrastructure to the EthereumStack, enabling developers to use a large scope of programming languages to target the Ethereum Virtual Machine (EVM) and benefit from LLVM’s mature tooling-ecosystem of debugging, validator, static analysis, etc.

In order for a blockchain to feature DApp functionality, it required a new decentralized network of computers, a new operating system, and a new programming language. This is why the EVM and Solidity were created. Solidity is by far the leading smart contract programming language for EVM-based blockchains and other blockchains are compatible with Solidity written contracts. However, smart contract developers have a love-hate relationship with Solidity due to its unfamiliarity and immaturity. So, how can we help DApp developers write more interesting and useful DApps? How can we further enhance the developers’ capability to write more interesting and useful DApps? What is the answer to improve DApps’ quality, portability, and lifespan? What should we do to reduce the hassles and chores to write and maintain DApp code?

What is LLVM?

LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine code. LLVM can be used as a compiler framework, where you provide the “front end” (parser and lexer) and the “back end” (code that converts LLVM’s representation to actual machine code).

So now we have the existing LLVM:

And then we’re doing:

LLVM supports a variety of front-ends, including Rust, Objective C, Fortran, Ada, Haskell, Java bytecode, Python, Ruby, ActionScript, GLSL, and others. On the other hand, LLVM also allows you to support new target platforms (WASM). In this case, we are adding EVM to the family.

What does LLVM bring to EVM based blockchain ecosystems?

More programming languages. Do you want to code your contract with Rust? Or Golang? or OCaml? Or even some other fancy languages like Haskell? An EVM backend for LLVM makes it finally possible to adopt them for contract programming. Enabling more languages to access the EVM will allow more developers to build DApps on Ethereum Classic as well as other EVM-based blockchains. With more language choice, it’s no doubt that this will be an improvement to the DApp developer experience.

Mature toolchain support. The LLVM ecosystem consists of lots of high-quality tools that help with development, including tools for debugging, validator, static analysis, etc. Take a look at this page.

Future-proof and long-term support. The LLVM community is committed to supporting LLVM project to an extended lifespan, making it one of the most widely accepted toolchain platforms. Similarly, developers who base their development on LLVM-base infrastructure will continue to receive the benefit and support from the LLVM community. In short, the best way to build a future-proof toolchain is to bring the large and mature LLVM ecosystem into Ethereum.

Collaborating Partners

ETC Core and Second State are collaborating to complete a build pipeline for EVM use in LLVM. Second State’s SOLL compiler generates compatible LLVM-IR that can utilize the LLVM-EVM-backend to translate to EVM-bytecode.

The LLVM-EVM project complements the SOLL compiler to provide an EVM target for the compiler toolchain. The EVM is the dominant smart contract execution engine today. We believe that EVM and Ewasm (eg the Second State VM) will co-exist for the foreseeable future. LLVM-EVM together with SOLL bridges and unifies the developer experience between EVM and Ewasm. — Michael Yuan from Second State

On the other hand, Vyper team is also experimenting with code generation on LLVM infrastructure.

Vyper sees the LLVM-EVM backend project as a real win for smart contract development. The world-class, mature tooling and optimization infrastructure that LLVM provides will lead to safer and more performant code for EVM-based smart contracts, especially when paired with EVM-only languages like Vyper. This backend will support hundreds of deployed public and enterprise chains that already run the EVM, the most proven VM that exists for the production use of smart contracts in real-world applications. — Vyper team.

What’s next?

Programming Language Developers

EVM LLVM is a compiler backend for smart contract engine EVM. If you are interested in building your own smart contract DSL (Domain Specific Language) on LLVM, or thinking about porting over an existing language, you can get started by downloading the source code at the official EVM-LLVM project’s Github repository and visiting the initial documentation at https://llvm.etccore.io/. We will try to provide as much help as possible.

Compiler Developers

The project needs your help. If you are interested in developing the LLVM-based smart contract compiler backend:

  1. take a look at its technical article at https://github.com/etclabscore/evm_llvm/wiki/files/Generating_stack_machine_code_using_LLVM.pdf
  2. Read the Wiki page at https://github.com/etclabscore/evm_llvm/wiki
  3. Ask questions, give suggestions, or fork the project and make PRs! We need all the help from the community!

In the long term, we are planning to upstream the backend to official repo. The project welcomes any help it can use!

Smart Contract Developers

Please tune in for the news from our collaborating partners! Soon you can use various LLVM-based platforms to develop smart contracts.

--

--