Themata.AI
Themata.AI

Popular tags:

#developer-tools#ai-agents#llms#claude#code-generation#ai-ethics#openai#ai-safety#anthropic#open-source

AI is changing the world. Don't stay behind. Clear summaries, community insight, delivered without the noise. Subscribe to never miss a beat.

© 2026 Themata.AI • All Rights Reserved

Privacy

|

Cookies

|

Contact
rustwasmdeveloper-toolsllms

We rewrote our Rust WASM Parser in TypeScript – and it got 3x Faster

Rewriting our Rust WASM Parser in TypeScript | OpenUI

openui.com

March 20, 2026

7 min read

Summary

OpenUI is rewriting its openui-lang parser from Rust to TypeScript to improve latency in converting a custom DSL emitted by an LLM into a React component tree. The original Rust-based parser utilized a six-stage pipeline but was found to be optimizing the wrong aspects for performance.

Key Takeaways

  • The openui-lang parser was initially built in Rust and compiled to WASM, but the performance bottleneck was found to be the overhead of crossing the WASM boundary, not the Rust code itself.
  • An attempt to optimize by skipping JSON serialization and returning a JS object directly resulted in a 30% decrease in performance due to the need for multiple conversions between Rust and JS data structures.
  • The parser pipeline was successfully ported to TypeScript, achieving significant speed improvements with a 2.2x to 4.6x increase in parsing speed compared to the original WASM implementation.
  • The original streaming architecture of the parser had an inefficiency that caused it to re-parse the entire string from scratch for every LLM chunk, leading to an O(N²) complexity in processing.

Community Sentiment

Positive

Positives

  • The algorithmic improvement from O(N²) to O(N) through statement-level caching significantly enhances user-perceived latency, showcasing the importance of optimization beyond language choice.
  • Rewriting the code allowed for the application of better practices and rectification of previous design flaws, emphasizing that thoughtful engineering can yield substantial performance gains.
Read original article

Source

openui.com

Published

March 20, 2026

Reading Time

7 minutes

Relevance Score

62/100

🔥🔥🔥🔥🔥

Why It Matters

This page is optimized for focused reading: quick context up top, a clean summary block, and a direct path to the original source when you want the full story.