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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The security model of WebAssembly

122 点作者 jbaviat将近 7 年前

2 条评论

wyldfire将近 7 年前
For some reason I assumed this might include specifics about spectre mitigations.<p>Heading off on that tangent: the mitigation for browsers was to turn off the time reference or to downsample the resolution, right? What if they do the work to sync up with a remote reference clock? Including characterization of the channel&#x27;s jitter&#x2F;RTT&#x2F;all that cleverness? Could they have high enough precision to deduce speculative execution? Or were there other mitigations that I&#x27;m not recalling?<p>(apologies for the tangent, none of this post is wasm specific)
评论 #17615231 未加载
评论 #17615250 未加载
sillysaurus3将近 7 年前
One interesting aspect of webassembly is that it&#x27;s feasible to do some advanced program-specific architectures.<p>Consider a website whose img src references are not actually strings, but instead are pointers to memory addresses. Your application works like this: When you attempt to dereference the pointer, a page fault fires, which causes the underlying system to load the image from the server. When the loading is complete, your program resumes.<p>Big deal. But this opens up another interesting avenue: It&#x27;s very easy to return a <i>different</i> image while you&#x27;re waiting for the original to load. Meaning there is no async&#x2F;await -- no waiting at all. You just write code in the natural, blocking way. No callback hell or promise chains.<p>There are other interesting applications of this too. When you dereference the pointer to the image, you know the user&#x27;s viewport size. Meaning you know how large the image should be. Therefore the underlying system can automatically request a perfectly-sized image from the server -- or have the server construct it on the fly, then stream it to the client.<p>You never have to deal with any of this complexity yourself.<p>The most important area where this type of design is applicable is gaming. You want to stream the exact texture miplevels you need, at an ~infinite level of detail. If you approach a wall, you want to see lots of high resolution wall textures. But when you move away from the wall, that texture data should be freed. The above architecture handles this type of concern automatically.
评论 #17614355 未加载
评论 #17614381 未加载
评论 #17615709 未加载
评论 #17614347 未加载
评论 #17614443 未加载
评论 #17616463 未加载