Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uncomputable/rustier-simplicity
"If you know Rust, you already know Simplicity."
https://github.com/uncomputable/rustier-simplicity
bitcoin circuit learning library logic rust tutorial
Last synced: about 2 months ago
JSON representation
"If you know Rust, you already know Simplicity."
- Host: GitHub
- URL: https://github.com/uncomputable/rustier-simplicity
- Owner: uncomputable
- License: cc0-1.0
- Created: 2023-04-16T15:38:31.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-11T15:04:29.000Z (10 months ago)
- Last Synced: 2024-04-11T21:51:40.933Z (10 months ago)
- Topics: bitcoin, circuit, learning, library, logic, rust, tutorial
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Playground
"If you know Rust, you already know Simplicity."
Simplicity is not hard and this repo tries to show that by implementing it using the Rust type system.
No pointers are used; everything lives on the stack.
Everything is as close to the [tech report](https://github.com/ElementsProject/simplicity/blob/pdf/Simplicity-TR.pdf) as possible.
Feel free to read the code and the report side by side.## Values
Learn about types and values in [src/value.rs](https://github.com/uncomputable/simple-playground/blob/master/src/value.rs).
There is an example in [examples/values.rs](https://github.com/uncomputable/simple-playground/blob/master/examples/values.rs).
Values serve as data.
There are unit, sum and product types.
Bits and byte strings of arbitrary length can be encoded using these primitives.```
cargo run --example values
```## Combinators
Learn about combinators and execution in [src/combinator.rs](https://github.com/uncomputable/simple-playground/blob/master/src/combinator.rs).
There is an example in [examples/combinators.rs](https://github.com/uncomputable/simple-playground/blob/master/examples/combinators.rs).
Combinators serve as functions that work on data (aka values).
There are nine combinators: unit, iden, take, drop, injl, injr, pair, comp, case.
Any total function that works on bits or bytes can be computed by some combinator.```
cargo run --example combinators
```