TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Using WebAssembly to turn Rust crates into fast TypeScript libraries

88 点作者 chriscbr将近 2 年前

5 条评论

throwme_123将近 2 年前
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 未加载
sestep将近 2 年前
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.
chgo1将近 2 年前
Nice writeup! A small improvement: There is `#[serde(rename_all = &quot;camelCase&quot;)]` to avoid typing all properties twice.
评论 #36559008 未加载
andymac4182将近 2 年前
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?
scottgpaulin将近 2 年前
That&#x27;s really cool! Just saved to home screen for when I need to compile something to wasm