<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/mk3geubeu" -->

---
title: Rewriting our Rust WASM Parser in TypeScript | daily.dev
description: A team built a custom DSL parser in Rust compiled to WASM, then discovered the bottleneck wasn't computation but the WASM-JS boundary overhead. Attempting to...
canonical: https://daily.dev/posts/mk3geubeu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rewriting our Rust WASM Parser in TypeScript | daily.dev
og:description: A team built a custom DSL parser in Rust compiled to WASM, then discovered the bottleneck wasn't computation but the WASM-JS boundary overhead. Attempting to...
og:url: https://daily.dev/posts/mk3geubeu
og:image: https://api.daily.dev/og/posts/MK3geuBEu.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rewriting our Rust WASM Parser in TypeScript

**[Kahlil Wallace](https://daily.dev/sources/7eqfesqrdx0muv3n92gxt)** · [@khauma](https://daily.dev/khauma) · 82 upvotes · 1 comments

## Summary

A team built a custom DSL parser in Rust compiled to WASM, then discovered the bottleneck wasn't computation but the WASM-JS boundary overhead. Attempting to skip JSON serialization via serde-wasm-bindgen made things 30% slower due to fine-grained boundary crossings. Rewriting the parser in TypeScript eliminated the boundary entirely, yielding 2.2-4.6x faster per-call performance. They also fixed an O(N²) streaming problem by caching completed statement ASTs, reducing total streaming cost by 2.6-3.3x. Key lessons: WASM shines for compute-bound tasks with minimal interop, not for frequently-called parsers on small inputs where boundary overhead dominates.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.openui.com/blog/rust-wasm-parser>

## Community discussion

Top comments from developers on daily.dev.

**@lambda\_joe** · 2 upvotes

> Excellent reminder to be very mindful whenever I/O is involved.
>
> Batching is your friend.

## Similar posts on daily.dev

- [We compiled our TypeScript parser to WASM](https://daily.dev/posts/we-compiled-our-typescript-parser-to-wasm-1mn76cyyw) · Encore · 39 upvotes · 1 comments
- [Rust vs JavaScript & TypeScript: Performance and WebAssembly](https://daily.dev/posts/rust-vs-javascript-typescript-performance-and-webassembly-uaejhl6mu) · JetBrains · 51 upvotes · 0 comments
- [How did I improve the performance of WAT parser?](https://daily.dev/posts/how-did-i-improve-the-performance-of-wat-parser--eacywmakl) · Hacker News · 1 upvotes · 0 comments
- [WebAssembly vs. JavaScript: Testing Side-by-Side Performance](https://daily.dev/posts/webassembly-vs-javascript-testing-side-by-side-performance-uai1ulk0u) · The New Stack · 0 upvotes · 0 comments
- [TypeScript 7.0 Rewrote Its Compiler in Go. Builds Are Now 10x Faster.](https://daily.dev/posts/typescript-7-0-rewrote-its-compiler-in-go-builds-are-now-10x-faster--x8yxxxlve) · Medium · 5 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#typescript](https://daily.dev/tags/typescript), [#rust](https://daily.dev/tags/rust), [#webassembly](https://daily.dev/tags/webassembly)

[View this post on daily.dev](https://daily.dev/posts/mk3geubeu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/mk3geubeu","headline":"Rewriting our Rust WASM Parser in TypeScript","text":"Shared: Rewriting our Rust WASM Parser in TypeScript","url":"https://daily.dev/posts/mk3geubeu","datePublished":"2026-03-22T10:42:35.978Z","dateModified":"2026-03-22T10:42:35.981Z","author":{"@type":"Person","name":"Kahlil Wallace","url":"https://daily.dev/khauma","image":"https://media.daily.dev/image/upload/s--QvppE9Ip--/f_auto/v1767378558/avatars/avatar_7eQFeSQRDx0muV3n92gxT?_a=BAMAK+ZW0","description":"A nerd who loves software development but is down for longboarding, bouldering or martial arts!","worksFor":{"@type":"Organization","name":"Yellow Duck Technologies","logo":"https://media.daily.dev/image/upload/s--sJ49BN2f--/f_auto,q_auto/v1782805767/logos/yellow-duck-technologies?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":14280}},"image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":82},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/l5Hpi7Vvy"},"comment":[{"@type":"Comment","text":"Excellent reminder to be very mindful whenever I/O is involved.\nBatching is your friend.","datePublished":"2026-03-23T15:59:55.309Z","dateModified":"2026-03-23T16:00:03.716Z","url":"https://daily.dev/posts/MK3geuBEu#c-gfDK7VJby","author":{"@type":"Person","name":"Joseph Martin","url":"https://daily.dev/lambda_joe","image":"https://avatars.githubusercontent.com/u/152159053?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/7eqfesqrdx0muv3n92gxt","name":"Kahlil Wallace"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kahlil Wallace","item":"https://daily.dev/sources/7eqfesqrdx0muv3n92gxt"},{"@type":"ListItem","position":3,"name":"Rewriting our Rust WASM Parser in TypeScript"}]}
```

