README.md 3.62 KB
Newer Older
Hero Bird's avatar
Hero Bird committed
1 2
# pDSL - Parity's DSL for Smart Contracts

3 4 5 6 7 8 9 10 11 12 13 14 15
| Linux              | Codecov              | Coveralls              |      LoC         |
|:------------------:|:--------------------:|:----------------------:|:----------------:|
| [![linux][A1]][A2] | [![codecov][C1]][C2] | [![coveralls][D1]][D2] | [![loc][E1]][E2] |

[A1]: https://travis-ci.org/Robbepop/pdsl.svg?branch=master
[A2]: https://travis-ci.org/Robbepop/pdsl
[C1]: https://codecov.io/gh/Robbepop/pdsl/branch/master/graph/badge.svg
[C2]: https://codecov.io/gh/Robbepop/pdsl/branch/master
[D1]: https://coveralls.io/repos/github/Robbepop/pdsl/badge.svg?branch=master
[D2]: https://coveralls.io/github/Robbepop/pdsl?branch=master
[E1]: https://tokei.rs/b1/github/Robbepop/pdsl?category=code
[E2]: https://github.com/Aaronepower/tokei#badges

Hero Bird's avatar
Hero Bird committed
16
**IMPORTANT NOTE:** WORK IN PROGRESS! Do not expect this to be working.
Hero Bird's avatar
Hero Bird committed
17

Hero Bird's avatar
Hero Bird committed
18
An [eDSL](https://wiki.haskell.org/Embedded_domain_specific_language) to write WebAssembly based smart contracts in the Rust programming language.
Hero Bird's avatar
Hero Bird committed
19

20 21
- [`pdsl-core` API documentation](https://robbepop.github.io/pdsl/pdsl_core/index.html).

Hero Bird's avatar
Hero Bird committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
## Goals

| Core Goals | |
|:-:|:-|
| **Ecosystem** | Allow for easy integration with the current Rust library ecosystem. |
| **Tooling** | Make the great Rust tooling work out-of-the-box for smart contract code. This includes auto-completion, syntax highlighting, code coverage for tests, go-to definitions and other IDE goodies. These should all work without any custom configuration. |
| **Testing** | Make smart contract code as easy to test as using `cargo test`, and make most testing be possible without a blockchain environment at all. |
| **Building** | Make building of smart contract code as easy as using `cargo build`. This does not necessarily mean that you will be able to just type `cargo build`. It might need a separate subcommand. |

| Key Attributes | |
|:-:|:-|
| **Efficient** | Compile smart contract code to machine code that is _at least_ as efficient as if you used the low-level function calls directly. |
| **Robust** | Make it as simple as possible to write code that just does what is expected and as difficult as possible to write incorrect or exploitable code. |
| **Simple** | Smart contract code should be as easy-to-read as possible. |
| **Accessible** | Make it accessible to users by providing excellent documentation and teaching materials. |
Hero Bird's avatar
Hero Bird committed
37 38 39

## Structure

Hero Bird's avatar
Hero Bird committed
40 41 42 43 44 45
| Module | Description |
|:-------|:------------|
| `pdsl_core` | The core utilities used to write smart contracts. |
| `pdsl_derive` | A future eDSL based on `pdsl_core` to provide a user friendly interface to writing smart contract code. |
| `pdsl_tests` | Test smart contracts written using pDSL that act as an acceptance test harnish. |
| `examples` | Featuring some smart contracts written for clarity with focus on teaching users how to use pDSL to write their own contracts. |
Hero Bird's avatar
Hero Bird committed
46

Hero Bird's avatar
Hero Bird committed
47
## Current State
Hero Bird's avatar
Hero Bird committed
48

Hero Bird's avatar
Hero Bird committed
49 50
The core abstractions and foundational work has been done in `pdsl_core`.
Even though it is still missing lots of its planned functionality it can already be used to simplify writing smart contracts compared to the bare bones approach.
Hero Bird's avatar
Hero Bird committed
51

Hero Bird's avatar
Hero Bird committed
52 53
Using it is still coupled with writing lots of boilerplate code.
This problem is going to be solved in the future by the upcoming `pdsl_derive` module.
Hero Bird's avatar
Hero Bird committed
54

Hero Bird's avatar
Hero Bird committed
55
## Contribution
Hero Bird's avatar
Hero Bird committed
56

Hero Bird's avatar
Hero Bird committed
57
The project is currently in experimental phase. We will provide contribution guidelines as soon as we feel that the time for external contributions has come. We are eager to work towards that.
Hero Bird's avatar
Hero Bird committed
58 59 60 61

## License

The entire code within this repository is licensed under the [GLP-v3](LICENSE). Please [contact us](https://www.parity.io/contact/) if you have questions about the licensing of our products.