diff options
-rw-r--r-- | posts/01_04_2023-advent-of-wasm.html | 119 | ||||
-rw-r--r-- | posts/index.html | 15 | ||||
-rw-r--r-- | resources/style.css | 4 |
3 files changed, 134 insertions, 4 deletions
diff --git a/posts/01_04_2023-advent-of-wasm.html b/posts/01_04_2023-advent-of-wasm.html new file mode 100644 index 0000000..129d47f --- /dev/null +++ b/posts/01_04_2023-advent-of-wasm.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<html> + <head> + <title>Advent of Wasm</title> + <link rel="stylesheet" href="/resources/style.css"/> + <meta name="viewport" content="width=device-width, initial-scale=1"> + </head> + <body> + <nav> + <a href="/">Home</a> + <a href="/about.html">About</a> + <a href="/posts/">Posts</a> + </nav> + <h1> + Advent of Wasm + <span class="subtitle">Now with 87% more pain</span> + </h1> + + <p> + So the last few years I have done Advent of Code off and on. Sometimes + I have tried to learn a new language, other times I was just trying to + beat my dad each evening. This year though, this year I don't know what + I was thinking. + </p> + + <p> + It was several weeks after everyone else had started, I had largely written + it off for the year - I was not up for it. Until a terrible idea crossed + my mind. + </p> + + <p> + Like an intrusive thought, my mind asked: "Well you've been wanting to do + something in web assembly for a while right? How bad could it be?" + </p> + + <br/> + + <p> + Turns out I was definitely not ready for this. + </p> + + <h2>So what was so hard about it?</h2> + + <p> + More than anything else, I forgot how much you need to do by hand to do + any sort of assembly. The first day saw me spending several hours just + on some loader code to pass the puzzle input in from JS, call a wasm + function, and then read back the result. + </p> + + <p> + Next was a few functions for reading numbers out of the wasm memory buffer, + parsing them from ascii, etc. The core read loop was not too tricky, but + the bit that took far longer than it had any reason to was converting my + answer back to ascii and shoving it into an output area. + </p> + + <p> + Really none of it was surprising, and none of it <em><strong>*should*</strong></em> + have been that hard ... it's just been a while since this Javascript girl + has written truly low-level code. + </p> + + <p> + To make matters worse I got hard-core distracted by the non-wasm part of + my wasm project. After the first day I returned to my stub JS loader and + expanded it into a little wasm explorer. + </p> + + <p> + I added a code view, syntax highlighting, auto-loaded my puzzle inputs, + even made a janky little dynamic list that would automatically pick up + new days' solutions as I added them to the repo without needing me to + touch the loader page each day. + </p> + + <p> + In the end I'm really quite proud of it, I will absolutely be reusing + this setup for future years, and you should + <a href="https://aoc2022.tempest.dev/" target="_blank">check it out</a> + if you haven't already ... but for wanting to challenge myself with + something new I was doing a lot of the same-old. + </p> + + <p> + Ultimately I got through 3 days before giving up jusst because every + step along the way involved <em><strong>*so much*</strong></em> extra + code. I may come back to some of the puzzles later, but for now I'm + kind of happy with what I did, and I don't feel like I need to prove + myself by doing more. I was doing it for fun, and so I stopped when + it stopped being fun. + </p> + + <h2>Tips if you want to get into writing wasm by hand?</h2> + + <p> + Uhh ... maybe consider don't? + </p> + + <p> + Jokes aside: do a throwaway project or two so you get used to passing + data into and out of wasm, whatever parsing you're going to do, etc. + </p> + + <p> + Do everything in your power to make sure you can focus on the actual + wasm part of your project, because (at least if you're anything like + me) it's easy to get sidetracked with all that. + </p> + + <p> + With that said: I had fun. Doing new things is always a treat, so if + you're looking for something new to try definitely consider giving + webassembly a look. + </p> + + </body> +</html> diff --git a/posts/index.html b/posts/index.html index 13bb767..b86c5a5 100644 --- a/posts/index.html +++ b/posts/index.html @@ -14,17 +14,24 @@ <h1> Posts </h1> - - <h2>2022</h2> + <h2>2023</h2> <ul class="posts"> <li> - <span>July 29</span> - <a href="/posts/07_29_2022-on-communities-and-trust.html">On Communities and Trust</a> + <span>January 4</span> + <a href="/posts/01_04_2023-advent-of-wasm.html">Retrospect: Advent of Wasm</a> </li> + </ul> + + <h2>2022</h2> + <ul class="posts"> <li> <span>August 1</span> <a href="/posts/08_01_2022-thoughts-on-neovim.html">Thoughts on Neovim</a> </li> + <li> + <span>July 29</span> + <a href="/posts/07_29_2022-on-communities-and-trust.html">On Communities and Trust</a> + </li> </ul> </body> </html> diff --git a/resources/style.css b/resources/style.css index ffdeb5c..7b727af 100644 --- a/resources/style.css +++ b/resources/style.css @@ -83,3 +83,7 @@ a[href^="http:"], a[href^="//"] { color: #caa5ff; } + +h2 { + margin-top: 48px; +} |