LLL Introduction¶
Note
This documentation is a work in progress, so please exercise appropriate caution. It a personal effort and has no formal connection with the Ethereum Foundation.
Note
Everything in these docs pertains to the Solidity/LLL implementation, specifically the develop branch.
Background¶
LLL is one of the original Ethereum smart contract programming languages and provides a different perspective and programming discipline when compared to the ubiquitous Solidity language.
According to the Ethereum Homestead Documentation,
Lisp Like Language (LLL) is a low level language similar to Assembly. It is meant to be very simple and minimalistic; essentially just a tiny wrapper over coding in EVM directly.
In particular, LLL doesn’t hide from you the highly resource-constrained nature of the EVM and enables efficient use of those limited resources. LLL facilitates the creation of very clean EVM code whilst removing the worst of the pain of coding for the EVM directly: namely stack management and jump management.
These pages aim to provide a reference resource for LLL contract development.
While these pages are based on the Solidity/LLL implementation, there is also a Viper/LLL implementation. Some of the info here may carry across; some may not.
Resources¶
The list of LLL-related resources currently available is quite short.
Authoritative Resources¶
The sole authoritative resource on LLL is the compiler source code itself.
(While this documentation aims to be accurate, there will certainly be errors and omissions.)
Tutorials¶
Daniel Ellison has put together a number of tutorial articles and screencasts on getting started with LLL.
- A seven part series of articles entitled The Resurrection of LLL.
- An ongoing series of articles on the Consensys media pages with links to screencasts for some of them.
Original Resources¶
The original LLL documentation is still available on GitHub and remains the starting point for this documentation set. However, that documentation was last updated in 2014, and significant things have changed since then.
Example Code¶
- The deployed Ethereum Name Service Registry was written in LLL.
- There is also a sample ENS Resolver in LLL.
- An ERC20 token implementation in LLL.
- The compiler built-in macros and end-to-end test suite are also useful references.
- Once again, Daniel Ellison has some code examples and demonstrations of useful techniques.
Warning some of the following examples may use features that have changed or been removed. Some examples may no longer compile.
- The original LLL Examples for PoC 5.
- A GavCoin contract.