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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

WebAssembly Stack Machine

116 点作者 brakmic超过 8 年前

7 条评论

CalChris超过 8 年前
The WA stack machine was added <i>late</i> in the game. Before that it was an AST but they got pushback from browser backend people and <i>pivoted</i> to a stack machine.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;755" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;design&#x2F;issues&#x2F;755</a><p>AST was a good idea and parsing as validation was excellent. Having a general stack machine makes validation much more difficult.<p>This is a bad decision (stacks vs AST or register) made for the wrong reason (code size). That&#x27;s a 1990s design assumption when memory was expensive and bandwidth was dear. Now memory is cheap; bandwidth is phenomenal; and latency is expensive.
评论 #12849221 未加载
评论 #12849778 未加载
评论 #12848822 未加载
评论 #12850404 未加载
评论 #12848954 未加载
bcg1超过 8 年前
If WASM runs on a stack machine, I wonder how hard it would be to map the instructions to JVM bytecodes? From the example in the document they look similar...<p>It would be interesting to be able to take code compiled with Emscripten for example and run it as part of JVM applications, similar to what NestedVM can do.
评论 #12848576 未加载
aspirin超过 8 年前
It makes me sad to see the AST go. I was thinking of writing my own WASM compiler just for fun, purely as an AST transformer.<p>Its funny how most of the WASM tools still use s-experssions as the text format. How does that even work, now that the AST is history?
评论 #12851462 未加载
pythonlion超过 8 年前
I just wanted to say Im really excited about this project. I hope it will come together and make software universal as the web we have today (if I understand it right). Anyways, how can I contribute?
评论 #12852792 未加载
shkaboinka超过 8 年前
I believe that switching to a stack machine is short-sighted and a big mistake:<p>The AST format could open up new possibilities for software, some of which are observable in Lispy languages like Scheme (I won&#x27;t list them here). Instead, we&#x27;re looking at locking the software world back into this 1960&#x27;s model for another 50 years out of a misguided concern for optimization over power.<p>It&#x27;s like foregoing the arch because it&#x27;s more work to craft, and instead coming up with a REALLY efficient way to fit square blocks together. Congratulations, we can build better pyramids, but will never grasp the concept of a cathedral.<p>To really grasp my point, I BEG you all to watch the following two videos in full and think hard about what Alan Kay &amp; Douglass Crockford have to say about new ideas, building complex structures, and leaving something better for the next generation:<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;oKg1hTOQXoY" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;oKg1hTOQXoY</a><p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=PSGEjv3Tqo0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=PSGEjv3Tqo0</a><p>As Alan Kay states, what is simpler: something that&#x27;s easier to process, but for which the software written on top of it is massive; or one that takes a bit more overhead, but allows for powerful new ways to model software and reduce complexity?<p>I believe that an AST model is a major start in inventing &quot;the arch&quot; that&#x27;s been missing in software, and with something that will proliferate the whole web ... how short-sighted it would be to give that up in favor of &quot;optimizing&quot; the old thing.<p>Imagine if instead of JavaScript, the language of the web had been Java? Lambdas would not be mainstream; new ways of doing OOP would not be thought of; and all the amazing libraries that have been written because of the ad-hoc object modeling that JavaScript offers. Probably one of the messiest and inefficient languages ever written, yet one of the most powerful ever given. C&#x27;mon, let&#x27;s do it a step more by making it binary, homoiconic, and self-modifying.<p>Thanks.
评论 #12861667 未加载
erichocean超过 8 年前
I&#x27;d prefer it was an SSA representation, like SPIR-V in Vulkan, or LLVM IR. Missed opportunity IMO.
sofaofthedamned超过 8 年前
I&#x27;m confused about all of this - is WebAssembly related to the Google Native Client stuff they did and are now deprecating? Is there a write-up of how it works?
评论 #12850073 未加载
评论 #12849480 未加载
评论 #12849377 未加载
评论 #12849618 未加载