-- Leo's gemini proxy

-- Connecting to iceworks.cc:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

WASM's lack of Goto makes compilers more complicated

Created: 2023-07-27T17:43:00-05:00

Return to the Index


WASM intentionally reduces control flow to a specific, structure format. This format does not include support for labels and gotos. Thus it becomes easier to write a translator and interrogation software for--but makes encoding logic to WASM more difficult.

Arbitrary control flow requires using a counter and a switch block, surrounded in a loop, so the destination label can be assigned and break to the next iteration where a switch dispatches it.

Some [potentially complex] algorithms are then needed to get away from this trope. The trope works but has poor performance as it involved making constant dispatches. So algorithms like Relooper and Stackifier make a compiler more complex with heuristics to try and avoid the dispatch loop mantra.


WebAssembly Troubles part 2: Why Do We Need the Relooper Algorithm, Again?

Github ticket about gotos again

Stackifier algorithm to replace Relooper


-- Response ended

-- Page fetched on Thu Jun 6 22:14:07 2024