Engineering brief

Cutting SDK Duplication in Half with a Rust Core

InfoQ2 min read · saves 38 min

At a glance

Relevance
Practical value
Warnings
None

Temporal cut new-language SDK dev time in half and reduced bugs by centralizing 70k lines of logic in a shared Rust core. But the bridge layer’s type conversion, async bridging, and memory management dominate; plan hooks and side-effect routing early.

Shows a repeatable pattern for scaling multi-language SDKs with a shared core, reducing duplication and bugs while maintaining language-native experiences.

Summary

Temporal’s SDK team faced 70,000 lines of state-machine logic needing duplication across seven languages. Rewriting was unsustainable. Their fix—a shared Rust core with per-language bridges—cut development time in half and reduced bugs by centralizing logic. The pattern isn’t novel, but the engineering lessons are stark: this architecture demands careful bridge design and constant tradeoff management.

The bridge layer concentrates complexity: type conversion, async bridging, memory management. PyO3 and Neon eased Python and Node, but Ruby required hand-rolled unsafe code. JSON serialization nearly beat direct object creation in Node—measure performance assumptions. Keep bridges thin; avoid fancy types at the boundary.

Leaders should weigh tradeoffs. Native extensions are unpopular in Go and Java, blocking retrofits. A key regret: not routing all side effects through the language layer upfront, costing customizability. WebAssembly offers a promising future—portable bytecode, no native extensions—but it’s early. Plan injection hooks from the start, or face fiddly knobs later.

The takeaway: Invest in bridge engineering and resist auto-generating everything—idiomatic user APIs still matter. For teams scaling multi-language products, a Rust core can deliver consistency and velocity, but it requires strong systems thinking and early planning for extensibility.

Watch the video

This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.

Related breakdowns

Get TL;DW

Too Long; Didn't Watch.

A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.

Free. Weekly. No hype.

Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.