Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukewilliamboswell/roc-platform-template-rust
Rust platform template
https://github.com/lukewilliamboswell/roc-platform-template-rust
roc-lang
Last synced: about 2 months ago
JSON representation
Rust platform template
- Host: GitHub
- URL: https://github.com/lukewilliamboswell/roc-platform-template-rust
- Owner: lukewilliamboswell
- License: upl-1.0
- Created: 2024-05-18T12:30:06.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-18T01:06:58.000Z (about 2 months ago)
- Last Synced: 2024-12-18T02:24:43.268Z (about 2 months ago)
- Topics: roc-lang
- Language: Roc
- Homepage:
- Size: 653 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- roc-awesome - Rust platform template
README
# Roc platform template for Rust
This is a template for getting started with a [roc platform](https://www.roc-lang.org/platforms) using [Rust](https://www.rust-lang.org).
If you have any ideas to improve this template, please let me know. 😀
## Developing locally
### Step 0. Dev environment
Dependencies:
- Nix package manager `nix develop`
- Otherwise ensure you have Roc and Cargo installed### Step 1. Build the platform
```
$ roc build.roc
```Build the platform with `roc build.roc` to produce the prebuilt-binaries in `platform/`.
### Step 2. Run an example
After the platform is build, you can run an example using `roc`.
```
$ roc examples/hello.roc
Roc loves Rust
```### Step 3. Run all the tests
```
$ ROC=roc EXAMPLES_DIR=examples/ ./ci/all_tests.sh
```## Packaging the platform
Bundle the platform first using `roc build.roc`, and then create a bundle with:
```
$ roc build --bundle .tar.br platform/main.roc
```This will package up all the `*.roc` files a prebuilt host files `*.a` `*.rh` etc from `platform/` and give you a file like `platform/GusyN64cWI5ri8GtTv90sgKKjEtj2i8GXKaWhI0-Tk8.tar.br` which you can distribute to other users by hosting online and sharing the URL.
## Platform documentation
Generate the documentation with `roc docs platform/main.roc` and then serve the files in `generated-docs/` using a webserver.
## Advaced - LLVM IR
You can generate the LLVM IR for the app with `roc build --no-link --emit-llvm-ir examples/hello.roc` which is an authoritative reference for what roc will generate in the application object.