Home | Notifications | New Note | Local | Federated | Search | Logout
Note Detail
Reply to @mcc@mastodon.social
mcc@mcc@mastodon.social (2026-10-02 12:13:35)
Alright! That… wasn't so hard!
https://github.com/mcclure/aoc2024/blob/7f6e479c88bcb251bf8fbb7b716da0660c787be2/11-01-stones/src/puzzle.wast
Friendlier than a lot of ASMs, and everything *un*friendly stems from tool ugliness (lack of step debugger; I wound up not using any of the neat LISP argument nesting or parens-optional features bc they broke too easily). After 16 months of being stuck on building WAST at all I wrote the whole "part 1" program in one day.
It doesn't work on the actual puzzle input because I wrote it around u32s and the assigned input needs u64s. FRICKING
---Reply---
mcc@mcc@mastodon.social (2026-10-02 12:18:29)
Behold my angonies. I guess at least it's a good thing I anticipated overflow might happen and checked for it, instead of just letting it happen and generating an incorrect result?
---Attachments---
image: https://files.mastodon.social/media_attachments/files/117/369/146/272/749/516/original/61427b5ab565df97.png
Reply
---Replies---
mcc@mcc@mastodon.social (2026-10-02 12:24:59)
Maybe I can still get this working tonight, I think. I find-replace all "4"s with "8s" and find-replace all "i32"s with "i64"s.
This doesn't work. Of course it doesn't work! Pointers are 32 bit in wasm32! That's why they call it wasm32! I can't just promiscuously use one integer type for both pointers and values, I'm gonna have to actually think out not only the type of every variable but the type of every arithmetic operation!
I guess this is why people stopped writing assembly language!!
---Attachments---
image: https://files.mastodon.social/media_attachments/files/117/369/174/718/684/710/original/3ec73b8630e7bd45.png