Sign In / Up

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:

  1. 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.
  2. 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.
  3. Security - The language is designed with blockchain environments in mind, allowing developers to add custom conditions to any transaction to prevent unexpected behavior.
  4. 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

Lesson discussion

Swap insights and ask questions about “Build On Stacks”.

Be the first to start the discussion

Ask a question or share your thoughts about this lesson.