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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

From a WebAssembly Perspective

78 点作者 tsegratis超过 2 年前

6 条评论

jillesvangurp超过 2 年前
Assembly script is pretty interesting as a language. It&#x27;s close enough to type script that the transition from that should be relatively easy for people already using that. And performance wise it gets them a lot of benefits.<p>There are a lot of other languages coming to wasm. It looks like garbage collection is stabilizing. E.g. jetbrains released an experimental wasm compiler for Kotlin recently that uses that. Currently that only works if you launch Chrome with some experimental flags to enable the feature. But at some point that will be generally available there, and in other browsers.<p>So, whether you are using C#, Kotlin, Swift, Crystal, or any other garbage collected modern language, chances are there will be a wasm compiler for it soon (if not already) and rich ecosystem of libraries and tools. I see this as a matter of time. Right now it&#x27;s all a bit cutting edge. So, the whole space is dominated by languages not in need of garbage collection (C, C++, Rust, etc). However, that will change pretty soon.<p>E.g. Swift and Kotlin are already used for modern UI development on mobile. Using those languages in a browser makes total sense. Kotlin actually has a js transpiler and there are some Kotlin specific web frameworks that I&#x27;ve used. With wasm and the inevitable emergence of new UI frameworks targeting wasm and browsers, there might be a little renaissance in web ui development. Things like Figma prove that web uis don&#x27;t have to be laggy, limited, and driven by css &amp; dom trees.
评论 #32591194 未加载
评论 #32594142 未加载
PoignardAzur超过 2 年前
&gt; <i>What are good use cases for AssemblyScript?</i><p>&gt; <i>Computation-heavy logic like image manipulation, hot game logic, specialized algorithms, emulators, compilers and the likes are great use cases for WebAssembly, and as such for AssemblyScript as well. In some situations it may also be preferable to ship bytecode instead of minified JS, or just the ability to utilize a TypeScript-like language may open up new opportunities, for example for embedded scripting or plugins.</i><p>That doesn&#x27;t really answer the question of why you would want to use AssemblyScript instead of eg C++ or Rust.<p>It&#x27;s not as if you get any of the benefits of Javascript, except for a familiar syntax.
评论 #32591410 未加载
评论 #32592021 未加载
评论 #32591215 未加载
评论 #32591645 未加载
评论 #32591164 未加载
tsegratis超过 2 年前
This is cool<p><pre><code> i32.ctz(...) f64.reinterpret_i64(...) i64.load32_u(...) </code></pre> I didn&#x27;t realize that was possible in WebAssembly&#x2F;AssemblyScript<p>Makes it a great target! Which I guess is what it was designed for :)
donatj超过 2 年前
I have used Go’s web assembly target a fair bit. The output wasm has an initial overhead of about a megabyte, and goes up pretty rapidly from there. This really limits the cases I’d like to use it in. Beyond that, the performance is generally several times slower than native.<p>I’ve had AssemblyScript recommended to me for exactly these reasons, but the one thing Go does have is a pretty great library ecosystem that AssemblyScript lacks.
评论 #32595253 未加载
andsoitis超过 2 年前
Tangent: are there <i>any</i> GC (or other automatic memory management) languages that compile to WASM yet?<p>Constraint: has to be production-ready or very near production-ready.
评论 #32593805 未加载
评论 #32594573 未加载
bugmen0t超过 2 年前
&quot;Why the strange name? AssemblyScript is to Assembly as JavaScript is to Java. Not quite.&quot;<p>Lovely.