arch: Rust rewrite evaluation — decided against (two exceptions noted) #33
Labels
No labels
free-tier:live
priority:backlog
priority:high
priority:medium
status:active-dev
status:alpha
status:beta
status:concept
status:design
status:launched
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/roadmap#33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Decision
Evaluated a full Rust rewrite of the menagerie (including via Python→Rust transpiler). Decision: no rewrite, no transpiler.
Why not
I/O-bound, not CPU-bound. Products are waiting on LLM inference, API round-trips, and DB writes. Rust's primary wins (no GC pauses, zero-cost abstractions, memory safety) apply to CPU-bound or latency-critical systems code. FastAPI + asyncio is not the bottleneck anywhere in the stack.
ML/audio layer is irreplaceable in Python.
faster-whisper,pyannote,transformers,YAMNet,librosahave no Rust equivalents. Rust code in the hot path would call back into Python (viapyo3) anyway, adding a language boundary with no benefit.Transpilers are not ready.
py2manyand similar tools handle only a narrow, idiomatic-Python subset and produce unidiomatic Rust requiring heavy hand-editing. Maintaining transpiler output is the worst of both worlds.Velocity cost is too high. Products are alpha/beta. A rewrite would delay shipping significantly with no user-facing benefit.
Two legitimate exceptions — revisit later
no_stdRust is a real option over MicroPython for production embedded firmwarepyo3Rust extensionStanding rule
Do not raise Rust as a solution for menagerie performance without profiling evidence of a CPU-bound bottleneck first. If something is slow, profile it — the answer is almost always the LLM call, network round-trip, or DB write.