TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using WebAssembly to turn Rust crates into fast TypeScript libraries

88 pointsby chriscbralmost 2 years ago

5 comments

throwme_123almost 2 years ago
Why fast?<p>In our experience, the cost of boundary-crossing between wasm and js make it slower than js implementation for everything dom-related.
评论 #36558700 未加载
评论 #36557661 未加载
评论 #36557498 未加载
评论 #36557684 未加载
sestepalmost 2 years ago
Nice post! We&#x27;re compiling Rust to Wasm for a numerical optimizer and got an order of magnitude speedup compared to our previous TypeScript implementation. It was tricky to get all the build pieces working together though.<p>Our team just uses wasm-bindgen though, and not wasm-pack; curious how much additional value you get from the latter? I could be mistaken but my impression is that wasm-pack uses Webpack; we&#x27;ve generally been trying to use esbuild instead (to make build times faster) but I haven&#x27;t used wasm-pack beyond running the tutorial so maybe I don&#x27;t know what I&#x27;m missing.
chgo1almost 2 years ago
Nice writeup! A small improvement: There is `#[serde(rename_all = &quot;camelCase&quot;)]` to avoid typing all properties twice.
评论 #36559008 未加载
andymac4182almost 2 years ago
I have a need to create 1 library that can be reused in JVM, NodeJS&#x2F;TS, Python, Go.<p>I remember reading something about doing something similar to this but it creates libraries for multiple languages. Have you done something similar before or do you have an idea where to look?
scottgpaulinalmost 2 years ago
That&#x27;s really cool! Just saved to home screen for when I need to compile something to wasm