I clean up from last time, then write an interpreter which can execute assertions about integer literals.
https://github.com/tomstuart/wasminna...
00:00:00 — Waiting to start
00:01:12 — Hello
00:03:07 — Retro
00:09:17 — Refactoring
00:11:37 — Move `private` and `attr_accessor` further up the file
00:13:12 — Extract #try_match helper
00:15:52 — Extract #complain helper
00:17:28 — Extract #parse_list helper
00:19:23 — Rename wasm.rb to wasminna.rb
00:19:55 — Pushing to GitHub
00:21:01 — Add MIT licence
00:22:16 — Split out S-expression parser and tests into separate files
00:22:36 — Interpreting `int_literals.wast`
00:28:49 — Add skeleton of Interpreter class
00:33:11 — Add skeleton of Interpreter#interpret
00:52:21 — Store function definitions when interpreting module
00:53:37 — Look up the function being invoked by `assert_return`
01:10:56 — Add skeleton #evaluate function and hook it up to #interpret
01:14:53 — Begin implementing `return` and `i32.const` instructions
01:20:50 — Introduce dummy #interpret_integer function and use it where needed
01:24:24 — Determine the base of integer literals and convert with #to_i
01:30:17 — Add required `bits:` argument to #interpret_integer
02:07:20 — Support negative numbers in #interpret_integer
02:08:42 — Implement the `i32.add` instruction
02:30:42 — Mask the result of #interpret_integer to be the right bit width
02:31:01 — Support `i64.const` and `i64.add`
02:41:24 — Recognise all `i32.*` and `i64.*` instructions and extract the bit width
02:52:40 — Recognise `i32.const` and `i64.const` inside assertions with a regular expression
02:53:18 — Wrap long pattern
02:57:57 — Wrapping up
02:58:36 — Teaser for next time
03:01:14 — Bye