Build On Stacks
Clarity Basics
What is Clarity?
Clarity is a functional programming language designed specifically for developing smart contracts on the Stacks blockchain. Unlike many traditional programming languages that follow an imperative paradigm, Clarity adopts a functional approach where computation is treated as the evaluation of mathematical functions while avoiding changing state or mutable data.
Why Clarity was chosen for Stacks?
Clarity was deliberately selected as the programming language for Stacks due to several advantages it offers over other languages in the blockchain context:
- Predictability - By following a functional paradigm and having no side effects, Clarity code is highly predictable and reduces ambiguity, which is critical for financial applications.
- No Compiler - Clarity code is not compiled but deployed to the network as-is, eliminating the risk of bugs being introduced during the compilation process.
- Security - The language is designed with blockchain environments in mind, allowing developers to add custom conditions to any transaction to prevent unexpected behavior.
- Decidability - Clarity is designed to be decidable, meaning it's possible to determine how much a given smart contract will cost to execute just by looking at the code, without actually running it.
For Diving Clarity 👉 here
Clarinet local development environment
Comments
You need to enroll in the course to be able to comment!