Skip to content
HarmonicLabsPublic

About

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

Resources

Code of conduct

Contributing

Stars

179 stars

Watchers

13 watching

Forks

Latest commit

 

History

916 Commits

Folders and files

Repository files navigation

A simple, yet rock solid, functional language with an imperative bias, targeting UPLC

what is pebble?

Pebble is a smart-contract language for Cardano with TypeScript-shaped syntax — const, if, C-style for loops, structs, generics, modules — compiled to Untyped Plutus Core (UPLC) by a whole-program optimizing compiler. You write imperative-looking code; the compiler lowers loops to tail recursion, places every computation exactly once, and emits compact scripts that use the newest on-chain features (UPLC 1.2 case/constr, the protocol-version-11 builtins).

What you get out of the box:

  • a type system built for validators: data-encoded and sum-of-products structs, generics with monomorphization, exhaustive match, flow-sensitive narrowing, and the full script-context prelude (ScriptContext, Tx, Value, Interval, …);
  • a standard library covering the common dApp patterns — tx.signedBy, tx.findInput, tx.valuePaidTo, Value arithmetic, interval helpers, lists and linear maps;
  • a built-in test framework: pebble test runs unit and property tests on the real CEK machine, with typed fuzzers for every parameter type, user-defined via fuzzers, failing-input shrinking, and per-test cpu/mem budgets;
  • competitive output: Pebble holds the lowest CPU numbers in the UPLC-CAPE two_party_escrow real-world benchmark and the factorial open benchmark (where it leads memory too) — see BENCHMARKS.md and the live report.

Benchmarks

Pebble is benchmarked against Aiken, Plinth, Plutarch, Scalus and OpShin in IntersectMBO's UPLC-CAPE suite: results and methodology in BENCHMARKS.md, rendered charts on the live report.

Install

command line

npm install -g @harmoniclabs/pebble

or as library (in your project root dir)

npm install @harmoniclabs/pebble

Get started

Have a look at the pebble documentation where you can find some example projects to help you get started.

Sponsors ❤️

the sponsors.md file contains a list of supporters of this project.

Every one of them is special and is contributing to making this software available for everyone.

Project Catalyst

a collection of all proposals made in the past is in the catalyst-proposals.md file

About

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

Resources

Code of conduct

Contributing

Stars

179 stars

Watchers

13 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages