Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polybase/polylang
https://github.com/polybase/polylang
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/polybase/polylang
- Owner: polybase
- Created: 2022-09-12T08:21:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-07T10:42:20.000Z (about 1 year ago)
- Last Synced: 2024-11-14T01:34:50.121Z (29 days ago)
- Language: Rust
- Homepage: https://polylang.dev
- Size: 9.1 MB
- Stars: 37
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ethereum-rollups - Polylang
README
## Build
### Javascript
Install wasm-pack: `cargo install wasm-pack`
```bash
cd js
yarn build
```## Compiling Polylang to Miden
You can use the `compile` binary to compile Polylang functions to Miden. Compile outputs the generated Miden assembly to stdout, you can pipe it to `miden-run` to run it.
### Example of compiling and running a contract function
```bash
$ cargo run --bin compile -- contract:Account function:setName <<<'contract Account { id: string; name: string; function setName(newName: string) { this.name = newName; } }'$ cargo run --bin compile -- contract:Account function:setName <<<'contract Account { id: string; name: string; function setName(newName: string) { this.name = newName; } }' \
| cargo run -p miden-run -- \
--this-json '{ "id": "id1", "name": "John" }' \
--advice-tape-json '["Tom"]'# Output: this_json: {"id":"id1","name":"Tom"}
```### Example of compiling and running a standalone function
```bash
$ cargo run --bin compile -- function:main <<<'function main() { }' | cargo run -p miden-run
```## Test
```bash
cargo test && (cd parser && cargo test)
```## Contribution
Contributions of all sorts (bug reports, enhancement requests etc.) are welcome. For more information on contribution tips and guidelines, please see the [Contributing](CONTRIBUTING.md) page.