/progenitor

rule-based growth of hexagonal cells

Primary LanguageRustMIT LicenseMIT

Progenitor

This project is:

  • a testbed for growth of hexagonal cells
  • a cellular automaton with rules to be evolved
  • an open-ended playground for some ideas
  • a mess while I'm figuring out Rust

screenshot with turing drawing producing a fractal

This repo is a Rust library with bindings for Python (PyO3) and Typescript (wasm-bindgen).

Build snapshots/demos: log2.ch/progenitor

Named after progenitor cells.

Build and Run

Build Status

Rust Library

Run cargo build and cargo test.

Maybe try the random-search example:

cd crates/progenitor
RUSTFLAGS="-C target-cpu=native" \
    cargo run --release --example random-search

Webassembly Module

Install wasm-pack, e.g. cargo install wasm-pack.

cd crates/wasm
wasm-pack build

This will create a node package in the pkg directory.

Web Application

After the steps above, build and run the web application:

cd webapp
npm install
npm run dev

Then open http://localhost:8080 in a browser.

Python Module

Install https://python-poetry.org/, then run:

poetry install
RUSTFLAGS="-C target-cpu=native" \
  poetry run maturin develop -m crates/python/Cargo.toml --release

Then run one of the experiments:

poetry run py/tumbler_search.py

As an alternative, it is possible to build the Python module without using poetry and with minimal dependencies. Just run https://maturin.rs/ directly in the crates/python directory.