Top all-time · #2307
troubles.md
Personal blog · troubles.mdprogrammingsystems
troubles.md is a personal blog at troubles.md about programming and systems. Since 2018, 32 different Hacker News readers have linked it 43 times, most often “WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine”. No feed was found, so read it on the site itself.
Too few sampled comments (18) to say how often HN recommends it.?
Why HN links it
HN readers link this blog for its critiques of WebAssembly's design, especially its structured control flow (the relooper problem) and its argument that WebAssembly is not a stack machine.
- Recommended for · 1 comments
- One commenter says the criticism of WebAssembly as a stack machine is elaborated very well.
Summarised by Claude from a sample of 18 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine9 people · 9 mentions · first linked 2019-01-31
- Why does WebAssembly need the relooper algorithm, instead of gotos? (2019)6 people · 7 mentions · first linked 2019-02-01
- WebAssembly Is Not A Stack Machine6 people · 6 mentions · first linked 2020-04-28
- Inviting God's Wrath with Cursed Rust3 people · 3 mentions · first linked 2020-03-24
- /why-do-we-need-the-relooper-algorithm-again/3 people · 3 mentions · first linked 2022-07-12
- WebAssembly Troubles Part 4: Microwasm3 people · 3 mentions · first linked 2019-02-28
- In which the CPU changes my data under my nose2 people · 2 mentions · first linked 2018-05-17
What Hacker News says?
WASM isn't particularly low-level, in that it's a compiler's IR, with a few concomitant restrictions on how control flow is allowed to work. Here's a piece on those restrictions, and how they make implementation more difficult: http://troubles.md/why-do-we-need-the-relooper-algorithm-aga... > WebAssembly isn’t designed as a front-end language for general programming though, so what’s the problem? Well, WebAssembly d…
Comment linking /why-do-we-need-the-relooper-algorithm-again/
on “Tell HN: We are trying to get tail calls into the WebAssembly standard”Submitted How Rust 1.26 more than tripled the speed of my code as a story · 305 points
HN discussionOne pretty annoying thing with WASM is that it is pretty hard to generate due to requiring a structured control flow so anyone generating it must implement relooper och stackifier. Is there any work on solving this issue? http://troubles.md/posts/why-do-we-need-the-relooper-algorit...
Comment linking /posts/why-do-we-need-the-relooper-algorithm-again/
on “The Bytecode Alliance: Building a secure, composable future for WebAssembly”Submitted WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine as a story · 175 points
HN discussionhttp://troubles.md/posts/why-do-we-need-the-relooper-algorit... "There is one thing that may have been a major factor to the decision not to adopt arbitrary CFGs for WebAssembly control flow. I believe that V8 is an exception to most compilers in that it doesn’t represent code as a CFG at all - it maintains roughly JS-compatible control flow all the way from front-end to codegen. In order to support this V8 would ha…
Comment linking /posts/why-do-we-need-the-relooper-algorithm-again/
on “Firefox's low-latency WebAssembly compiler”Submitted WebAssembly Is Not A Stack Machine as a story · 174 points
HN discussionhttp://troubles.md/posts/wasm-is-not-a-stack-machine/ wasm is already tainted by the legacy of javascript. It was intended as a replacement for asm.js and carries the burden of being too intended to be with javascript and as a way to get "faster javascript" due to how poor javascript is at executing efficiently. The result is what I'd consider a poor mans java bytecode. The legacy of java was bloat connected to the…
Comment linking /posts/wasm-is-not-a-stack-machine/
on “Universal Binaries Using WASM”Submitted Why does WebAssembly need the relooper algorithm, instead of gotos? (2019) as a story · 144 points
HN discussionLLVM _is_ the backend for Mono. It's easier for LLVM to produce better code if it doesn't have to go via a register based bytecode VM like WebAssembly. Was discussed here not so long ago: http://troubles.md/posts/wasm-is-not-a-stack-machine/
Comment linking /posts/wasm-is-not-a-stack-machine/
on “Universal Binaries Using WASM”Submitted WebAssembly Troubles Part 4: Microwasm as a story · 134 points
HN discussionIt's not having a runtime that's the problem, it's limitations in WASM's control flow constructs: https://github.com/WebAssembly/design/issues/796#issuecommen... And WASM has this limitation as a consequence of limitations in the V8 and SpiderMonkey engines. See http://troubles.md/posts/why-do-we-need-the-relooper-algorit... and https://news.ycombinator.com/item?id=19997091 And those engines have those limitations b…
Comment linking /posts/why-do-we-need-the-relooper-algorithm-again
on “WebAssembly Interface Types: Interoperate with All the Things”Submitted WebAssembly Is Not a Stack Machine (2019) as a story · 66 points
HN discussionWASM is tied to existing JavaScript engines and their constraints. For example, WASM doesn't support more efficient control flow because of the design of V8 (and possibly SpiderMonkey): http://troubles.md/posts/why-do-we-need-the-relooper-algorit... https://news.ycombinator.com/item?id=19997091
Comment linking /posts/why-do-we-need-the-relooper-algorithm-again/
on “WebAssembly Interface Types: Interoperate with All the Things”Submitted WebAssembly Troubles part 4: Microwasm (2019) as a story · 45 points
HN discussionIt's great you emphasise it and I would generalise it even further. Any perf optimisation should be considered after reliably measuring (controlling for hot/cold cache, overall system load among others) its effect, instead of blindly adding unsafe everywhere. Similar to people who sprinkle their Cpp code with inline thinking it will force the compiler to inline. In fact, sometimes you can improve perf by adding an a…
Comment linking /rust-optimization/
on “How to speed up the Rust compiler in 2020”Submitted WebAssembly Troubles Part 3: The Stack Is Not the Stack as a story · 33 points
HN discussionI get the impression WASM is really a very clunky representation, far from what any greenfield project would ever have arrived at. That is to say, its decisions aren't just tradeoffs that people disagree about, they're simply inappropriate for what it's trying to do. More than once I've encountered comments and blog-posts lamenting its fundamentals, e.g. [0]. [0] http://troubles.md/wasm-is-not-a-stack-machine/
Comment linking /wasm-is-not-a-stack-machine/
on “What’s in that .wasm? Introducing wasm-decompile”Submitted In which the CPU changes my data under my nose as a story · 13 points
HN discussionAuthor here: I'm obsessed with the quality of streaming compiler-emitted code for a few reasons. Firstly, I'm working on an optimising streaming compiler. Secondly, I work for a blockchain company and we can realistically only allow linear-time compilation, this doesn't necessarily mean streaming compilation but we might as well make it both (I explain why we need linear-time compilation in a different article http:…
Comment linking /posts/why-wasm/
on “WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine”Submitted WebAssembly Is Not a Stack Machine as a story · 6 points
HN discussionThe inability to implement coroutines is addressed in the second article in the series here http://troubles.md/posts/why-do-we-need-the-relooper-algorit...
Comment linking /posts/why-do-we-need-the-relooper-algorithm-again/
on “WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine”Submitted Inviting God's Wrath with Cursed Rust as a story · 4 points
HN discussionOne issue with Wasm is you essentially can't target it with a single-pass compiler, unlike just about any real machine. Wasm can only represent reducible control flow, so you have to pass your control-flow graph through some variation of the Relooper[1,2]. I don't know if upstream tcc can do that (there are apparently some forks?..). [1] http://troubles.md/why-do-we-need-the-relooper-algorithm-aga... [2] https://med…
Comment linking /why-do-we-need-the-relooper-algorithm-again/
on “Show HN: Compiling C in the browser using WebAssembly”Submitted WebAssembly Troubles Part 4: Microwasm as a story · 4 points
HN discussionThere are some comments now... I guess a lot of people (like me) are interested in WASM, but most don't have enough knowledge to say anything "authoritative" about it. When I read "It is a stack machine, no registers", I remembered this other article http://troubles.md/wasm-is-not-a-stack-machine/ and thought "Ok now, these can't both be right at the same time, right?". But apparently they can - as another comment h…
Comment linking /wasm-is-not-a-stack-machine/
on “Notes on WebAssembly”Submitted WebAssembly Troubles Part 2: Why Do We Need the Relooper Algorithm, Again? as a story · 4 points
HN discussionIf you can't watch the video, there's a blog post writeup of Lightbeam by the presenter here - http://troubles.md/posts/lightbeam/
Comment linking /posts/lightbeam/
on “Lightbeam: A Highly-Optimising Streaming WebAssembly Compiler (2019) [video]”Submitted Achieve Warp Speed with Rust as a story · 3 points
HN discussionAfter this gained prominence I took a hard read of Koopman's Stack Computers: The New Wave intent on writing an interpreter. I sought some optimization properties that would apply to the modern requirements for ILP, OoE and parallelization at low core frequencies -- none are offered. This manifests in WASM, and the criticism was elaborated very well: http://troubles.md/posts/wasm-is-not-a-stack-machine/ > This essen…
Comment linking /posts/wasm-is-not-a-stack-machine/
on “Goodbye PNaCl, Hello WebAssembly (2017)”Submitted WebAssembly Troubles Part 1: WebAssembly Is Not a Stack Machine as a story · 2 points
HN discussion