Introduction to LIGO
Ligo, a SmartContract Language built for Mavryk
LIGO is a programming language for writing smart contracts, compiling in Michelson and deployable on Mavryk blockchain.
Our hope is to have a simple, strongly typed language with a low footprint. Most useful smart contracts can express their core functionality in under a thousand lines of code.
LIGO, for newcomers or confirmed developpers
Even if LIGO currently offers two syntaxes, you'll need to choose only one:
- JsLIGO, ideal for web developers, is a TypeScript/JavaScript inspired syntax without unnecessary complexity, which is not helpful in smart contract development. A quick way to produce your first dApp!
- CameLIGO is designed for developers with a background in functional programming, in particular OCaml. An OCaml-inspired syntax allows you to write in a functional style.
A significant advantage of the multi-syntax feature is to share knowledge, toolings, and modules (like libraries onto registry) in a larger community.
LIGO, designed to be cost-effective
Unlike desktop, mobile, or web application development, smart contracts cannot rely on cheap CPU time and memory. All resources contracts use are expensive and tracked as 'gas costs'.
The LIGO compiler generates optimised Michelson code, which will be cost-effective on Mavryk.
LIGO, designed for your security
Mavryk smart contract live on the blockchain forever if a bug exists, they cannot be patched or amended. Smart contracts often directly control money or assets, which if stolen, could be a large financial loss to the contracts and their users.
LIGO will bring people to web3 and by design reduce the risk that your smart contract will lose its balance to an avoidable exploit.
But compiler design is insufficient, and LIGO uses static analysis to encourage people to write simple code, avoid anti-patterns, and use the robust test framework which can simulate Mavryk blockchain and offer mutation tests
For critical code, LIGO also keeps its compiled output unbloated making possible to formally verify the compiled output using a project like Mi-Cho-Coq.
A set of tools already available
- Quickly explore LIGO using webide
- Quickly bootstrap a project with registry
- Improve development experience with our LSP server available in the VS Code extension
- Understand and troubleshoot your code with the debugger available in vscode extension
- Integrate LIGO to your pipeline with ligo github action
- Test your documentation with ligo-mdx
Where to start
Do you want to try LIGO?
For a quick overview, get-started is a good choice. Webide can be used to avoid installation onto your laptop.
Do you want to learn LIGO?
Your choice to learn LIGO is already available:
- Read basics to have a basic comprehension
- Write your first smart contract.
- Others resources are available on marigold.dev
Do you want to build a production-ready project?
You will need a deeper comprehension:
- Teach yourself how to structure your code with Combining code section
- Learn how to write tests we strongly encourage to use breathalyzer library from the LIGO registry.
- Understand how to secure a contract
Dig deeper
In the end, maybe you will want to: