NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Ported my C game to WASM, here's everybug that I hit (ernesernesto.github.io)
arcadialeak 5 minutes ago [-]
I 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 the Web, really). Maybe this will bear fruit in that people will make more Native user interfaces again.
thewavelength 12 minutes ago [-]
Why is a relatively new technology like WASM being limited to 32-bit pointers? Why repeat the same mistake again?

> Web is 32-bit. Your 64-bit structs will break. This was the root cause of most of my bugs. WASM is 32-bit address space, pointers are 4 bytes not 8.

unwind 36 minutes ago [-]
Meta: a space is missing in the title.

Since this is one of the bugs, I always recommemd writing

    game->boardPieces = swAlloc(sizeof(ThingHandle*) * row * column);
Like this instead:

    game->boardPieces = swAlloc(sizeof *game->boardPieces * row * column);
It's not 100% better, but it cuts out a few tokens which helps readability and moves the significant asterix further left where I think it's easier to spot.
ErroneousBosh 8 minutes ago [-]
> Meta: a space is missing in the title.

I like the word "everybug" :-D

nhinck3 8 minutes ago [-]
Probably a firefox bug but the interface hit boxes are misaligned when fullscreen
xydone 13 minutes ago [-]
The memory64 proposal was merged into upstream last year, any reason to opt into 32 bit despite that?
sestep 7 minutes ago [-]
It's slower. Wasm32 can just reserve 4 GiB of the virtual address space from the OS for each memory, so checking for out-of-bounds memory accesses imposes no performance penalty. Wasm64 can't do that, so each memory access is a bit slower.
pioh 47 minutes ago [-]
i want to hack 99 night in the forest
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 12:14:32 GMT+0000 (Coordinated Universal Time) with Vercel.