|
2 | 2 |
|
3 | 3 | libprocessing is an experimental native library with the goal of supporting the implementation of the core Processing API in a variety of languages. The library is written in the [Rust programming language](https://rust-lang.org/) and built on top of the [Bevy game engine](https://bevy.org/). libprocessing uses [WebGPU](https://webgpu.org/) as its rendering backend and is designed to (eventually) support desktop, mobile, and web targets. |
4 | 4 |
|
5 | | -## Getting started |
| 5 | +## Getting Started |
6 | 6 |
|
7 | | -### mewnala (the python library) |
8 | 7 |
|
9 | | -Inside of our `processing_pyo3` crate we have created a python package that you can easily install with pip. |
10 | | -Again, we are still very nascent, but let us know what kinds of snags you may run into while getting this set up. |
11 | | -Try running the examples in the [processing_pyo3 examples directory](crates/processing_pyo3/examples). |
| 8 | +We are big fans of [uv](https://github.com/astral-sh/uv) and this is the easiest way to get started using `mewnala`. |
12 | 9 |
|
13 | | -We are big fans of [uv](https://github.com/astral-sh/uv) and this is the easiest way to get started using `mewnala` |
| 10 | +### installing uv |
| 11 | + |
| 12 | +**Setting up uv on Linux or Mac:** |
14 | 13 |
|
15 | | -#### Setting up uv on Linux or Mac: |
16 | 14 | ```bash |
17 | 15 | curl -LsSf https://astral.sh/uv/install.sh | sh |
18 | 16 | ``` |
19 | 17 |
|
20 | | -#### For Windows users: |
| 18 | +**Setting up uv on Windows:** |
| 19 | + |
21 | 20 | ```bash |
22 | 21 | powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
23 | 22 | ``` |
24 | 23 |
|
25 | | -#### Install a mewnala |
26 | | -```bash |
27 | | -# Initialize a project with uv |
28 | | -uv init mewnala-sketchbook && cd mewnala-sketchbook |
| 24 | +You'll need to install the Rust toolchain to work on this project. Most people will want to install Rust via [`rustup`](https://rustup.rs/), which helps manage Rust toolchain versions: |
29 | 25 |
|
30 | | -# add the package |
31 | | -uv add mewnala |
| 26 | +### Installing rustup |
32 | 27 |
|
33 | | -# run a sketch |
34 | | -uv run sketch.py |
| 28 | +**Setting up rustup on Linux or Mac:** |
| 29 | + |
| 30 | +```bash |
| 31 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
35 | 32 | ``` |
36 | 33 |
|
37 | | -### Rust (libprocessing) |
| 34 | +**Setting up rustup on Windows:** |
38 | 35 |
|
39 | | -You'll need to install the Rust toolchain to work on this project. Most users will want to install Rust via [`rustup`](https://rustup.rs/), which helps manage Rust toolchain versions: |
| 36 | +Download and run [these binaries](https://rustup.rs/#) for [Windows 64-bit](https://win.rustup.rs/x86_64) or [Windows on ARM](https://win.rustup.rs/aarch64). |
40 | 37 |
|
41 | | -**For Linux and Mac users:** |
| 38 | +### Add the wasm32 target for rustuo |
42 | 39 |
|
43 | | -```bash |
44 | | -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 40 | +You'll need the wasm32 target: |
| 41 | + |
| 42 | +```bash |
| 43 | +rustup target add wasm32-unknown-unknown |
45 | 44 | ``` |
46 | 45 |
|
47 | | -### Build commands |
| 46 | +### installing `just` |
48 | 47 |
|
49 | | -This project uses [just](https://github.com/casey/just) as a command runner. Run `just` to see available commands. |
| 48 | +This project uses [just](https://github.com/casey/just) as a command runner. |
50 | 49 |
|
51 | 50 | Before building, you'll need to install just: |
52 | 51 | ```bash |
53 | 52 | cargo install just |
54 | 53 | ``` |
| 54 | +Run `just` to see available commands. |
55 | 55 |
|
56 | | -## Building libprocessing for web |
57 | | - |
58 | | -The `processing_wasm` crate provides WebAssembly bindings that expose a JavaScript API mirroring the C FFI. |
59 | 56 |
|
60 | | -### Requirements |
| 57 | +### Install `wasm-pack` |
61 | 58 |
|
62 | 59 | Install [wasm-pack](https://rustwasm.github.io/wasm-pack/): |
63 | 60 |
|
64 | 61 | ```bash |
65 | 62 | cargo install wasm-pack |
66 | 63 | ``` |
| 64 | +The `processing_wasm` crate provides WebAssembly bindings that expose a JavaScript API mirroring the C FFI. |
67 | 65 |
|
68 | | -You'll also need the wasm32 target: |
69 | 66 |
|
70 | | -```bash |
71 | | -rustup target add wasm32-unknown-unknown |
72 | | -``` |
| 67 | +## Examples |
73 | 68 |
|
74 | 69 |
|
| 70 | +**libprocessing example** |
75 | 71 |
|
76 | | -### Build |
| 72 | + |
| 73 | +This outputs the package to `target/wasm/`. |
77 | 74 |
|
78 | 75 | ```bash |
79 | 76 | just wasm-build |
80 | 77 | ``` |
81 | | - |
82 | | -This outputs the package to `target/wasm/`. |
83 | | - |
84 | | -### Run the example |
| 78 | +This shows the example in your browser. |
85 | 79 |
|
86 | 80 | ```bash |
87 | 81 | just wasm-serve |
88 | 82 | ``` |
89 | 83 |
|
| 84 | +**Install a mewnala** |
90 | 85 |
|
| 86 | +```bash |
| 87 | +# Initialize a project with uv |
| 88 | +uv init mewnala-sketchbook && cd mewnala-sketchbook |
91 | 89 |
|
92 | | -## Contributing |
93 | | - |
94 | | -We want your help building this library! You can see a list of outstanding tasks in our [issues](https://github.com/processing/libprocessing). However, while we're still in the early phases, consider checking in with us first in the `#devs-chat` channel on [Discord](https://discord.gg/h99u95nU7q) to coordinate our efforts. |
| 90 | +# Add the package |
| 91 | +uv add mewnala |
95 | 92 |
|
96 | | -You can read our project design principles [here](./docs/principles.md). |
| 93 | +# Run a sketch |
| 94 | +uv run sketch.py |
| 95 | +``` |
0 commit comments