Home | Notifications | New Note | Local | Federated | Search | Logout
Note Detail
Reply to @mcc@mastodon.social
mcc@mcc@mastodon.social (2026-10-01 13:17:31)
At this point I ragequit the project, didn't look at it for 16 months, picked it up today, attempted to restart from scratch with the Spritely Hoot toolchain (https://files.spritely.institute/docs/guile-hoot/latest/Wasm-REPL-commands.html), failed at THAT,, looked at my 16-month-old code, suddenly realized I understood the conceptual issue that had stymied me before (as if I'd taken a 16-month shower and suddenly the problem made sense), threw out the huge block of code in which I failed to implement "printf", and successfully printed a number. (2/2)
---Attachments---
image: https://files.mastodon.social/media_attachments/files/117/363/715/325/126/782/original/0eaec78d057b0943.png
image: https://files.mastodon.social/media_attachments/files/117/363/715/743/226/045/original/125ba055781ab3d0.png
image: https://files.mastodon.social/media_attachments/files/117/363/716/056/606/684/original/842b09ef1c1d3cdc.png
---Reply---
mcc@mcc@mastodon.social (2026-10-02 02:58:29)
ME: Hey so is there a way to detect or prevent an integer overflow in multiplication in wasm? Carry flag, saturation, traps, anything?
HELPFUL FRIEND: No, wasm is conservative to the point of being unhelpful and you have to do those kind of checks yourself, they didn't want to commit to integer ops that some CPUs might not support
ME: Well okay I guess that's reasonable
WASM SPEC: Hey guys check it out I made an instruction that counts the number of 1 bits in a number https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Numeric/popcnt
Reply
---Replies---
mcc@mcc@mastodon.social (2026-10-02 02:59:27)
Have you ever got "how would you count the number of 1 bits in a number" as a question in a job interview? I've got that one before. Next time I get it I'm just going to smugly reply "compile to wasm and call i32.popcnt"