allo-isolate

Run multithreaded Rust alongside the Dart VM and post results straight into Dart isolates.

Library
Cargo
v0.1.27
126stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
37/100Needs Attention
Development Activity0
Maintenance0
Community68
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
68/100Good
Architecture73
Code Quality70
Innovation72
Learning Curve55

allo-isolate is a small, focused Rust crate that bridges native Rust code with the Dart virtual machine. It lets you run heavy, multithreaded Rust work off the Dart event loop and send the results back into a Dart isolate through Dart’s native ports, without blocking the UI thread. It is a foundational building block for Flutter plugins and any Dart application that offloads computation to Rust over FFI.

What You Get

  • An Isolate type that posts Rust values into a Dart isolate through its native SendPort
  • Support for spawning multithreaded and async Rust work that resolves back on the Dart side
  • Macros that hide the unsafe FFI plumbing needed to talk to the Dart VM
  • Optional integrations for anyhow, backtrace, chrono, and uuid via feature flags

Common Use Cases

  • Building Flutter plugins whose native layer is written in Rust
  • Offloading CPU-heavy computation from Dart to background Rust threads
  • Streaming incremental results from a long-running Rust task into Dart

Under The Hood

Architecture

allo-isolate centers on a single Isolate struct that holds a Dart SendPort identifier and a pointer to Dart’s Dart_PostCObject function pointer, which is initialized once via store_dart_post_cobject. Values implementing the crate’s IntoDart trait are converted into Dart’s C object representation and posted across the FFI boundary into the target isolate’s message queue. The src tree splits into the port plumbing, the IntoDart conversions for primitives and containers, and macro helpers.

Tech Stack

Pure Rust with no runtime dependencies in the default build; it relies on atomic for the port pointer and pulls in optional pin-project, anyhow, backtrace, chrono, and uuid only behind feature flags. It targets stable Rust edition 2021 and ships benchmarks under benches using criterion plus a valgrind suppression file for memory checking.

Code Quality

The code is compact and leans on unsafe for the FFI calls, isolated behind safe wrappers and macros. Tests live under tests/ covering container conversions and VM interaction, and the CI runs nightly lints, a security audit, and a Valgrind memory check, signalling care around the unsafe surface despite the small maintainer team.

API Design

The public API is deliberately minimal: construct an Isolate from a port and call post. The IntoDart trait makes supported types work transparently, and macros remove hand-written pointer code. Documentation is thin in the README but complete on docs.rs, so the learning curve comes mostly from understanding Dart’s native port model rather than the crate itself.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search