logoalt Hacker News

caderoscheyesterday at 10:33 PM1 replyview on HN

What is the purpose of the Rust WASM parser? Didn't understand that easily from the article. Would love a better explanation.


Replies

joshuanapoliyesterday at 11:16 PM

They use a bespoke language to define LLM-generated UI components. I think that this is supposed to prevent exfiltration if the LLM is prompt-injected. In any case, the parser compiles chunks streaming from the LLM to build a live UI. The WASM parser restarted from the beginning upon each chunk received. Fixing this algorithm to work more incrementally (while porting from Rust to TypeScript) improved performance a lot.