Earlier quoted context omitted.
You sounds like the misattributed Bill Gates of 2026.
No? Most consumer desktops have 8 or 16 GB and phones less. You want to use more than half for a web page? For reference 4 GB is 8x more than a ps3.
Ported my C game to WASM, here's every bug that I hit
91–100 of 116 posts
Re: Ported my C game to WASM, here's every bug that I hit
#92You can get real breakpoints, memory watching, etc in browser with the chrome debugging extension
https://marketplace.visualstudio.com/items?itemName=ms-vscod...
This allows to setup an IDE-like 'press F5 to build and start into a debug session' in VSCode, with the debuggee running in Chrome.
E.g. see:
Re: Ported my C game to WASM, here's every bug that I hit
#93Earlier quoted context omitted.
> I had no idea WASM is 32bit until I read your article! WASM(32) is a hybrid 32/64 bit architecture. The address range (and thus pointer size) is 32 bits, but it has native 64-bit integers. E.g. it's similar to the Linux x32 ABI. There is also a 'true' 64-bit wasm, but that's still too recent to be used in real-world code: https://caniuse.com/wf-wasm-memory64 (but wasm64 doesn't really make sense unless you really n…
> (but wasm64 doesn't really make sense unless you really need an address space greater than 32 bits, because the downside is slower performance) Or unless you need to use integer types that depend on pointer size (such as size_t or usize), but your integers are too large to fit in 32 bits. That's a pretty common occurrence in bioinformatics. I've been waiting for years for Wasm to become usable, but it looks like Ap…
Re: Ported my C game to WASM, here's every bug that I hit
#94Earlier quoted context omitted.
looks like I was wrong, but here is the de-facto standard I was relying on over the years ;-). Not that I've memcpied many structs to file directly btw. http://www.catb.org/esr/structure-packing/
The general struct layout algorithm is that you lay out the first member at the address of the struct (this is guaranteed by C), and then subsequent fields in order (also guaranteed by C). What isn't guaranteed is how fields get their alignment, in particular shenanigans you can do with allocating fields in the padding of their prior field, and bitfields in general are horribly underspecified. In practice, C doesn't…
C++ "standard layout type" is the modern equivalent of "POD" I think.
Re: Ported my C game to WASM, here's every bug that I hit
#95Earlier quoted context omitted.
Sometimes I wonder whether it's possible to run the wasm code in a separate sandboxed process to eliminate a lot of checks. I mean optionally, because normally JS calls wasm code synchronously in the same address space. The bridge will add more latency when there is a transition between JS and wasm. It's obviously complicated because some data structures can also be shared, such as SharedArrayBuffer.
> The bridge will add more latency when there is a transition between JS and wasm. This would be similar to how NaCl/PNaCl communicated with the JS side (via message passing), and that really sucked and would also be prohibitively slow for talking to 'high frequency APIs' like WebGL2 or WebGPU (or the DOM heh).
Re: Ported my C game to WASM, here's every bug that I hit
#96Earlier quoted context omitted.
Wasm still doesn't let you make native user interfaces, the UI is in the web browser. You can put native UI components into a React Native or Electron app though.
> Wasm still doesn't let you make native user interfaces That's currently only not possible because nobody wants to do the work to create something like wasi-gfx ( https://wasi-gfx.dev/ ), but for native UI frameworks instead of 3D APIs. The inconvenient truth is that even "native" cross-platform applications hardly ever go through the trouble to target the platform-native UI framework (and instead they go through no…
Re: Ported my C game to WASM, here's every bug that I hit
#97Earlier quoted context omitted.
which of these vulnerabilities are most concerning to you in wasm programs?
All of them.
Re: Ported my C game to WASM, here's every bug that I hit
#98Earlier quoted context omitted.
32 is better for a lot of things like simd. the strength of it is wasm can do both types now and js can't unfortunately. a number in js is strictly 64.
Not sure about SIMD. If you mean WASM, the main advantage of WASM32 over WASM64 is execution speed if it runs on a 64-bit runtime. This is because pointer accesses are simply 64-bit base pointer + 32/33-bit offset (the 32-bit pointer value in WASM program + some 32-bit optional offset). Since the offset in the memory access is already trimmed to 32/33-bit (in a 32-bit half of the register) at machine instruction leve…
Re: Ported my C game to WASM, here's every bug that I hit
#99Earlier quoted context omitted.
Why /s? That does massively reduce the exposure
As much as an OS process, on a modern OS that is. The bounds checking story is only on the external limits of linear memory segments. If memory gets corrupted inside a linear memory segment, it can equally well be exploited to change execution behaviour, which for many scenarios is already good enough for the attacker. Yet these kind of attack vectors usually are dropped from blog posts selling WebAssembly as a revol…
Re: Ported my C game to WASM, here's every bug that I hit
#100I love how WASM is the thing that finally blurred the line between Web and Native programming, formely two realms isolated from each other for a long time. This both develops better awareness of how the code is executed by the hardware, which JavaScript devs often lack, and also brings skilled folks from the Native platforms who seem to be not so against WASM as they were against JavaScript (and all other parts of th…
ActiveX, Alchemy, PNaCL,...
Is ActiveX platform independent? No. it's exclusive to windows. Is it sandboxed? Nope, digital signing and prayer, does it implement a virtual machine? Nope. Compromises out the wazoo? efficiency, data orientation, or predictable performance? You betcha. ActiveX is closer to a DOM sandbox escape exploit than a real piece of engineering. Why do we need WASM when we've have GET since 1990?
Don't confuse the map for the territory, implementation details matter, just labeling something "Mars Colonial Transporter" doesn't mean it actually flew to mars.