Developing flow
Supported Platforms
CI tests run on macOS and Linux (x86_64 and aarch64). Other platforms may work since Rust projects are portable, but these are the ones actively tested.
Pre-requisites
To build and test flow you need:
- Rust toolchain (
rustup,cargo,rustc) with thewasm32-unknown-unknowntarget clippyfor lint checkszmq(Zero Message Queue) librarymdbookandmdbook-linkcheckfor building the book
Getting Started
Clone the repo
git clone https://github.com/andrewdavidmackenzie/flow.git
Install build tools
You need make and a Rust toolchain (I suggest rustup).
Once you have those, install the remaining dependencies with:
make config
This installs the wasm target, clippy, graphviz, mdbook, and other tools.
It works on macOS and Linux variants using apt-get or yum.
Build and test
make
This builds everything, runs all tests (including examples), and builds the book. The first build takes a while due to WASM compilation of flowstdlib functions. Subsequent builds are incremental.
Make Targets
make— full build, test, and book (default)make build— build libs and binaries onlymake clippy— run clippy on all code including testsmake test— run all tests, including example output checksmake book— build the book and check links
Project Structure
The project is split into several Rust crates in a cargo workspace:
- Proc macros need their own crate
- Core types and code are shared across compiler and runner crates
- Libraries are separated from CLI binaries to enable UI applications
- The standard library (
flowstdlib) is separate from the compiler and runtime - Feature flags allow optional compilation of debugger, metrics, etc.
The main binaries are flowc (compiler), flowrcli (CLI runner), and
flowrgui (GUI runner). See Project Structure
for details.