~mpu/qbe

5 4

WebAssembly Support

Details
Message ID
<37c1d09e-bf23-4481-9784-a6760d3891f1@notgull.net>
DKIM signature
missing
Download raw message
Would WebAssembly support be desired for QBE? It would mean rewriting a
lot of "emit.c" and others, since WebAssembly is not assembled via GAS
or NASM but with WABT, which has an S-Expr-like format.
Details
Message ID
<5329124739AE80DEB6FAA7638D3E6D09@eigenstate.org>
In-Reply-To
<37c1d09e-bf23-4481-9784-a6760d3891f1@notgull.net> (view parent)
DKIM signature
permerror
Download raw message
Quoth John Nunley <dev@notgull.net>:
> Would WebAssembly support be desired for QBE? It would mean rewriting a
> lot of "emit.c" and others, since WebAssembly is not assembled via GAS
> or NASM but with WABT, which has an S-Expr-like format.

It would involve a lot more than that, since wasm doesn't allow
arbitrary control flow graphs.
Details
Message ID
<92c88f22-be0b-43c1-a425-6c3b2acc8c0a@notgull.net>
In-Reply-To
<5329124739AE80DEB6FAA7638D3E6D09@eigenstate.org> (view parent)
DKIM signature
missing
Download raw message
> It would involve a lot more than that, since wasm doesn't allow
> arbitrary control flow graphs.

That's fair, I suppose. It's the kind of thing I haven't put much
thought into yet.
Karurochari <me@karurochari.com>
Details
Message ID
<fd0563b6-ea4f-4aba-9aab-84f9f6acb7a8@karurochari.com>
In-Reply-To
<5329124739AE80DEB6FAA7638D3E6D09@eigenstate.org> (view parent)
DKIM signature
missing
Download raw message
 > It would involve a lot more than that, since wasm doesn't allow 
arbitrary control flow graphs.

May I ask you to elaborate a  bit more on this? Or, would you have any 
references to read and better understand what you mean by that?
Do you see WASM intrinsically incompatible as a target with the premises 
and/or the current architecture of QBE?
Details
Message ID
<4eirajkxxvkexbjm4wtedxtwfdrfsdqkgmn64k6azmh55hphdc@urc5sabmqjvr>
In-Reply-To
<fd0563b6-ea4f-4aba-9aab-84f9f6acb7a8@karurochari.com> (view parent)
DKIM signature
pass
Download raw message
On 2024-12-05 02:26AM, Karurochari wrote:
>> It would involve a lot more than that, since wasm doesn't allow 
>>arbitrary control flow graphs.
>May I ask you to elaborate a  bit more on this? Or, would you have any 
>references to read and better understand what you mean by that?
>Do you see WASM intrinsically incompatible as a target with the 
>premises and/or the current architecture of QBE?
This link has good overview of the limitations of WebAssembly's control 
flow: 
http://troubles.md/posts/why-do-we-need-the-relooper-algorithm-again/

I can't find the link now but there was some forum or mailing list 
thread where LLVM devs said that supporting WASM was "500x more 
difficult than any other architecture" without a shred of hyperbole.  
Mostly because WASM demands restrictions that no IR would impose on 
frontends so they have to map the looser requirements to the restricted 
environment using complex algorithms (and yet, in the case of control 
flow, Control Flow Graphs used by complex compilers still result in the 
same correctness guarantees WASM is attempting to enforce but with 
substantially more flexibility and optimization opportunities).

No clue the opinions of QBE in particular on it though.

~nytpu

-- 
Alex // nytpu
alex@nytpu.com
https://nytpu.com/ - gemini://nytpu.com/ - gopher://nytpu.com/
Karurochari <me@karurochari.com>
Details
Message ID
<95a48b6e-c7e8-495e-80be-bf1557e2bf3f@karurochari.com>
In-Reply-To
<5329124739AE80DEB6FAA7638D3E6D09@eigenstate.org> (view parent)
DKIM signature
missing
Download raw message
Thank you, it was a nice read :).
Reply to thread Export thread (mbox)