“Not all contracts are code. Some are rivers.”
RVRS is an experimental smart contract language for Cardano.
It treats code as ritual. Every contract is a flow: deliberate, symbolic, and evolving.
RVRS is written in Haskell, fully custom, and compiles to an Intermediate Representation (IR) designed for Aiken.
It is still forming. Still flowing.
These elemental constructs shape every ritual:
flow
: A container of purpose and invocationsource
: A declaration of origin, a variable springdelta
: A transformation, a shift in statebranch
: A decision point — a fork in the currentmouth
: A voice — the moment the contract speaksecho
: A return, the final reflection
These are the riverbed. The rest flows from here.
RVRS now supports typed declarations, scoped evaluation, branching, flow composition, and evaluation tracing.
- ✅ Core 6 syntax and flow-based semantics
- ✅ Expression parsing + arithmetic and logic ops
- ✅ Flow-to-flow calls with argument passing
- ✅ Typed
delta
andsource
declarations (delta x: Num = 5
) - ✅ Scoped variables, shadowing, and purity by default
- ✅ Echo-based return system and optional
mouth
tracing - ✅ Multi-flow files,
main
entrypoint, and standard rituals
- ✅ AST → IR lowering pipeline
- ✅ IR evaluator with scoped flows and error tracking
- ✅ Static typechecking of expressions and declarations
- ✅ Source, IR, and typecheck test runners:
RunAll
: full test suiteRunIRTests
: IR-level testsTestTypeCheck
: type inference and type error tests
- ✅ Standard library merging via
stdlib.rvrs
- ✅ Developer docs, guides, and module maps
flow giveDiscount {
return 0.1
}
flow computeTotal {
source base = 100
delta discount = call giveDiscount
source total = base - (base * discount)
mouth "start"
echo total
}
mouth: start
echo: 90.0
RVRS is designed to compile into Aiken, Cardano’s strongly typed smart contract language.
- Structured Output: Aiken gives RVRS a clear, functional target
- Faster Dev: Easier than writing directly in Plutus Core
- Type Safety: Aiken’s type system complements RVRS
- Ecosystem Fit: Great dev tools and growing Cardano community
📂 See examples/transpilation
for sample flows and Aiken targets.
- Full expression-level type enforcement
- Type-safe flow argument validation
- Return type inference and enforcement
- Traceable error logs and assertion flows
- REPL mode for interactive rituals
- Aiken backend integration
🎨 Philosophy
RVRS is a language of calm. A language of meaning.
- Symbolism over syntax
- Readability as ritual
- Clear evaluation and flow
- Inspired by rivers, nature, and the act of naming
👤 Created by Carlos Javier Rivera