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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why WebAssembly Is Faster Than Asm.js

238 点作者 dwaxe大约 8 年前

18 条评论

erikpukinskis大约 8 年前
WASM has it&#x27;s uses, for games and such. But on the web, the more weird stuff you do, the more friction you tend to introduce to your users. You can boot a JavaScript app, but the startup time will push people away. You can take months to replicate iOS animations, but the lack of bookmarkability will hamper your virality. Now you can compile C++ and run it in the browser, but you can&#x27;t use any of the existing web frameworks, and browser support is hit or miss.<p>The real questions are: what are you <i>really</i> doing that actually couldn&#x27;t be done with Craigslist-level technology? Does your application need to look and feel the way it does because you want show off what you are capable of, or because your customers would actually like you less if you did less?<p>What people keep missing is that the Web isn&#x27;t a platform, it&#x27;s an idea: It&#x27;s the idea that the lowest common denominator, or whatever crappy text-based document format is supported in every single device ever made, is actually good enough for almost everything. And you can add fanciness, and you can add features, but the weight of the web pulls all content towards that lowest common denominator.<p>This drives iOS developers crazy, because they want to be special snowflakes who make animations that run at 100hz and might make Dieter Rams notice them in the lunchroom. Platform after platform keeps challenging the web, and the web keeps chugging along. Because the web is not a tool, it&#x27;s the idea that we should communicate with as many people as we can, and to do that we should use the simplest technology that will do the job.
nitemice大约 8 年前
So let me get this straight: WASM is basically asm.js, but without having to go through javascript?<p>The future has changed! <a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;the-birth-and-death-of-javascript" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;the-birth-and-death...</a>
评论 #13883565 未加载
评论 #13882443 未加载
评论 #13884441 未加载
评论 #13885168 未加载
genjipress大约 8 年前
What seems most important about WebAssembly is that it is essentially a universal language runtime. It&#x27;s not that what it brings to the web is unimportant, just that it seems like we&#x27;re also getting a way to do truly cross-platform language deployment as a bonus. Am I wrong about this?
评论 #13882517 未加载
评论 #13881864 未加载
评论 #13882005 未加载
评论 #13881648 未加载
评论 #13883675 未加载
hackcasual大约 8 年前
Using Emscripten (with embind) 1.37.3 it takes slightly over 1 second to initialize a 2.7mb wasm file. The JS version shows slightly under 300ms for parse time, obviously not the same as the full WASM pass, but it does significantly delay initial page load.<p>The positive side is what took 250ms to run with cold JS (nothing JIT compiled) and 35ms after a few runs takes just 5ms the first time in WASM. This is on Chrome Canary on Windows.<p>Is there anything I&#x27;m missing to speed this up?
评论 #13881845 未加载
评论 #13882041 未加载
gcr大约 8 年前
Why aren&#x27;t we standardizing on something like Java bytecode or LLVM IR or CLR?<p>What problems with those existing technologies could wasm solve better?
评论 #13881952 未加载
评论 #13881945 未加载
评论 #13881933 未加载
评论 #13881870 未加载
评论 #13881898 未加载
评论 #13881941 未加载
Mindless2112大约 8 年前
&gt; indexes are LEB128s<p>This article is promoting how fast WebAssembly is to parse (and no doubt it is faster than JS), and yet LEB128 is a slower-to-parse representation than &quot;prefix varint&quot; with the same cost in bits [1][2]. It seems the designers didn&#x27;t actually care what was faster. [3]<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11263378" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11263378</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;stoklund&#x2F;varint" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stoklund&#x2F;varint</a> [3] <a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;601" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;601</a>
评论 #13885140 未加载
msoad大约 8 年前
Without a GC WASM is very hard to use for regular web development tasks. When GC infrastructure lands lots of mind-blowing stuff will happen. Things like JVM and .NET running in WASM.<p>A lot of web people don&#x27;t realize magnitude of impact WASM will have on the web.
评论 #13882141 未加载
评论 #13881912 未加载
评论 #13882880 未加载
评论 #13883047 未加载
评论 #13881961 未加载
评论 #13882798 未加载
评论 #13881669 未加载
评论 #13881647 未加载
评论 #13881909 未加载
评论 #13881962 未加载
ChicagoDave大约 8 年前
A colleague, Thilo Planz, is working on an Interactive Fiction VM based on the Glulx specification (1) called glulx-wasm (2). If completed, this will be integrated with fyrevm-web, a web platform for glulx+channel IO stories.<p>(1) <a href="http:&#x2F;&#x2F;www.eblong.com&#x2F;zarf&#x2F;glulx&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.eblong.com&#x2F;zarf&#x2F;glulx&#x2F;</a> (2) <a href="https:&#x2F;&#x2F;github.com&#x2F;thiloplanz&#x2F;glulx-wasm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thiloplanz&#x2F;glulx-wasm&#x2F;</a>
cm2187大约 8 年前
Do we know if we are likely to see support for WebAssembly for all platforms? It looks like a way to bypass the app store. I am surprised apple or google (on android) would be happy to do so.
评论 #13885287 未加载
评论 #13883164 未加载
6nf大约 8 年前
What languages do you all recommend for compiling to Wasm? I know Rust is an option and something like Nim would probably work well. What is the future of Wasm?
评论 #13885513 未加载
评论 #13881518 未加载
infogulch大约 8 年前
What if the javascript interpreter &#x2F; jitter was built in WASM and the jit target was WASM?<p>The browser could reduce its&#x27; surface area to just network, html&#x2F;css layout, compositing, and wasm. Js just becomes a special case with an automatically loaded wasm plugin.
Ericson2314大约 8 年前
I predicted this before, but somebody will do a cloud with webassembly. With all the extensions, this becomes quite an interesting middle ground between VMs and containers.
tambourine_man大约 8 年前
I though SIMD had already landed on WebAssembly.<p><i>That</i> will make asm.js look a lot slower and should get it closer to C&#x2F;C++ where it&#x27;s still lagging.
评论 #13884968 未加载
kevin2r大约 8 年前
By the time wasm supports GC languages like python or ruby, javascript may get a lot better. Will people still want to write client side apps in python?, even if it means that it will run slower and also you have to download the language runtime on a webpage load.
评论 #13882494 未加载
评论 #13883000 未加载
inDigiNeous大约 8 年前
Is it possible to compile javascript to WebAssembly or asm.js?
评论 #13885662 未加载
frik大约 8 年前
Who else thinks that Asm.js was okay, but WebAssembly is evil and might destroy the current web landscape. It&#x27;s like a trojan horse. Guess which companies are involved.
评论 #13882818 未加载
评论 #13882778 未加载
wtbob大约 8 年前
&gt; indexes are LEB128s<p>It&#x27;s just a personal nit and beside the point of the (rather short) article, but I&#x27;ve long felt it sad that the more correct &#x27;indices&#x27; is so rare and the correct-but-inelegant &#x27;indexes&#x27; is so very common.
ballenf大约 8 年前
The most popular language that you can&#x27;t compile into wasm is Javascript?<p>This issue was closed 12 hours ago: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;219" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;219</a><p>I know it&#x27;s cliche and been written about ad nauseum, but this really does feel like the trojan horse threat to MS, Apple and Android.
评论 #13882086 未加载
评论 #13882158 未加载