Yul Is the New Black

Yul is the new black: a blog around benefits of using yul.

Yul stands for Your Universal Language and it’s an intermediate language in Solidity.

Yul is a low-level, stack-based, assembly-like language that has been created to allow the compiler to be split into multiple libraries. Yul is the name of an island in Lake Geneva and also the initials of Yves Urbain de Lattre de Tassigny, a French general from World War II.

Yul will be used in the future as an optimiser for functions, but also for automated code generation for Solidity.

Yul is the new black. Yul is the high level language of choice for the coming year. It will become so popular that every single company will start using it, and yul will be the mainstream programming language by 2020. Oh yes…

Yul can do everything you can possibly imagine. It is also a programming language that compiles to EVM bytecode, which means you can write programs in Yul and execute them on the Ethereum Virtual Machine (EVM). You can even interact with smart contracts written in Solidity.

The syntax of yul looks like this:

Yul is the new black, and here’s why.

The impact of the yul language on Solidity, the smart contract language for Ethereum, has been tremendous. The latest version of Solidity is a lot more readable and maintainable than before.

The main cause for this improvement is the introduction of composite types (structs) and functions. With these additions, it is possible to modularize and split a contract into several files, which makes it more readable and maintainable.

But what about Yul? How does Yul fit into all this? Well, as a matter of fact, Yul is the hidden backbone behind many of these new features in Solidity.

Yul was originally developed by Christian Reitwiessner to introduce assembly-level features to Solidity (see EIP-215). However, it can be used for much more: It can be used as a low level language for building smart contracts in general. Since it uses a stack machine approach, it is closer to the EVM than Solidity or Vyper. Therefore, I believe that we will see more and more projects using yul directly to build their smart contracts.

Yul is the new black. Anyone who has looked at the bytecode produced by Solidity knows that this is a well-deserved reputation: it is often difficult to understand and debug, even for the most experienced of developers.

Yul is a language centered around the idea of creating good bytecode, not necessarily human readable code. It has a very simple and efficient compilation scheme, so that it can be used as an intermediate language within compilers or even as a target language for high-level languages. Yul stands for Your Ultimate Language, which might have been meant as a joke but is not entirely devoid of truth.

But why would you want to use something like yul instead of just writing Solidity directly? The answer is similar if you ask why you would use C++ instead of assembly language: it allows you to work at a higher level of abstraction, thereby making your life easier and your code more readable by humans. It also makes your code more robust because many common errors (such as out-of-bounds access) can be caught statically by the compiler. And last but not least, it produces significantly better output than hand-written Solidity in pretty much all cases.

It’s no secret that many developers are often quite opposed to Yul. But if you’re one of these people, we want to make the case for Yul and explain why you should reconsider this stance.

Last week, we published a blog post around the launch of yul. It was a long time coming. Anyway – now that it’s out there, I’m going to take some time and address some of the points raised in the comments.

So why should we use yul?

Speaking as one of the engineers who has been using Yul for years, I have to say: it’s pretty great. I think it’s mostly because of how much time it saves me. Let’s face it: writing bytecode by hand is pretty laborious and tedious (and slow). But writing code that writes bytecode for me is not just easier, but also faster. And it means I can catch bugs earlier in the development cycle.

We are excited to announce the support of yul in Remix.

Yul is a high-level programming language for writing smart contracts. It was originally designed to be used as an assembly language for the EVM, but it has gained many other uses since then. Yul is a part of the 0xcert Framework, an open-source library that provides tools for building powerful decentralized applications.

This blog post will describe some of the advantages and benefits of using yul over Solidity and motivate you to start experimenting with it. The post assumes basic knowledge about Ethereum Virtual Machine (EVM) and intermediate knowledge about Solidity, as well as some familiarity with Yul. We will go through some concepts that are important and unique to yul and discuss their implication on the point of view on smart contract development process and security in general.

Yul has been here all along

Yul was initially created as an assembly language for the EVM by the Ethereum Foundation in 2015 under the name Serpent2 (Serpent was the first language developed by the Foundation). Its main purpose was to compile down directly to opcodes, making it easier to write in-depth optimisations for Solidity compilers. At that time, however, this approach turned out to be less

Yul is the Assembly language for the Ethereum Virtual Machine. It is a high level programming language, developed by Ethereum foundation. Yul provides much more functionality than the EVM Assembly and it is designed to be easily translated to EVM Assembly.

Yul is a high level language intended to be used as an intermediate representation in compilers. It can also be used as an expression format on its own, in which case it can be compiled to bytecode or assembly code manually.

The most important feature of Yul is that it allows to separate the data flow from the control flow. This makes it easier for optimizers to analyze contracts and make them cheaper, faster and safer.

Yul is a stack based language. The parser produces a syntax tree, which gets transformed into an IR (intermediate representation) before being translated into bytecode (or assembly).

Leave a Reply

Your email address will not be published.