Turn any Rust crate into a Zeta package. Automatically.
Dark Factory is the official Rust-to-Zeta transpiler, built by the Zeta Foundation. It parses Rust source code via syn, walks the AST, and emits equivalent Zeta source — preserving types, generics, traits, macros, extern blocks, and the full serde data model.
Used to produce all 46+ packages on zorbs.io, including:
@async/tokio— Full async runtime, 373 files, 36k lines@stdlib/regex— Regular expression engine, 218 files, 69k lines@data/serde— Serialization framework, 24 files, 7.4k lines@net/hyper— HTTP/1.1 + HTTP/2 library@crypto/ring— Cryptography (AES, SHA, ECDSA, Ed25519)@net/hyper,@net/reqwest,@net/tower— Full web stack
# Convert a single Rust file
df convert input.rs -o output.zeta
# Convert an entire crate directory
df crate path/to/crate
# Fetch a crate from crates.io and convert it
df fetch serde
# Full pipeline: fetch → convert → compile → publish
df pipeline clap --publishcargo install dark-factory| Command | Description |
|---|---|
df convert <file> |
Convert a single .rs file to Zeta |
df crate <dir> |
Convert an entire crate directory |
df fetch <name> |
Fetch a crate from crates.io and convert |
df pipeline <name> |
Full pipeline: fetch → convert → compile → publish |
df rules |
List available AST rewrite rules |
Dark Factory operates in three passes:
- Parse — Uses
synto parse Rust source into a full AST (File, Items, Expressions, Types, Patterns, Macros) - Emit — Walks the AST and emits Zeta source text. Each Rust construct has a corresponding
emit_*function:emit_fn,emit_struct,emit_enum,emit_impl,emit_traitemit_mod,emit_use,emit_const,emit_static,emit_typeemit_macro— fullmacro_rules!preservationemit_foreign_mod—extern "C"block handling
- Polish — An 11-phase post-processor cleans up
proc_macro2spacing artifacts (::→::,assert ! (→assert!(, turbofish, generics, doc URLs, etc.)
Converted 46+ packages totaling ~300,000+ lines of Zeta with zero unsupported items across every crate. Tested on:
serde(24 files, 7.4k lines)regexecosystem (218 files, 69k lines)tokio(373 files, 36k lines)clap_builder(57 files, 11k lines)rayon+rayon-core(104 files, 17k lines)crossbeamecosystem (42 files, 7.4k lines)futuresecosystem (409 files, 30k lines)- And 35+ more
MIT