Making a WebAssembly interpreter in Ruby, part 21: inline unfolding and identifier contexts

preview_player
Показать описание

00:00:00 — Waiting to start
00:00:46 — Hello
00:02:27 — Retro
00:08:09 — Use #repeatedly to read minimum and maximum memory size
00:19:48 — Extract #parse_memory_data helper
00:23:46 — Extract #parse_memory_sizes helper
00:26:59 — Extract #parse_unsupported_assertion helper
00:29:19 — Extract #parse_binary_fields and #parse_text_fields helpers
00:36:02 — Always read list inside #parse_assert_return
00:42:20 — Extract #parse_float_expectation helper
00:44:57 — Extract #parse_expecteds helper
00:47:12 — Read `param` or `result` list inside conditional in #parse_type
00:54:10 — Use two separate loops to parse `param`s and `result`s in #parse_type
00:56:38 — Move `parameters` and `results` local variables inside #read_list block
00:57:45 — Extract #parse_parameter and #parse_result helpers
01:02:49 — Extract #parse_parameters and #parse_results helpers
01:05:55 — Make each case read its own opcode in #parse_function
01:12:28 — Use #parse_parameter and #parse_result helpers in #parse_function
01:13:22 — Extract #parse_index helper
01:21:39 — Read and discard limits in #parse_table
01:31:10 — Read an ID, not an index, in #parse_table
01:33:07 — Extract #parse_local helper
01:36:34 — Extract #parse_elements helper
01:42:34 — Use #parse_results helper in #parse_structured_instruction
01:48:07 — Extract #read_labelled helper
01:54:42 — Unconditionally parse alternative in #parse_structured_instruction
01:57:06 — Extract #parse_consequent helper
01:58:26 — Extract #parse_alternative helper
01:59:11 — Extract ID_REGEXP regular expression
02:02:02 — Extract INDEX_REGEXP regular expression
02:04:24 — Use separate conditional to parse `export` in #parse_function
02:09:56 — Use separate conditional to parse `type` in #parse_function
02:13:45 — Use separate #parse_parameters call to parse `param`s in #parse_function
02:15:54 — Use separate #parse_results call to parse `result`s in #parse_function
02:16:45 — Implement #parse_locals helper
02:22:48 — Use separate #parse_locals call to parse `local`s in #parse_function
02:23:17 — Clean up vestigial code in #parse_function
02:23:59 — Extract #parse_export helper
02:26:31 — Extract #parse_typeuse helper
02:30:56 — Extract #read_lists helper
02:35:35 — Stop reading `br_table` arguments if we hit a list
02:57:38 — Use #parse_instructions to unfold all plain instructions
03:02:00 — Use #parse_instructions to unfold all structured instructions
03:25:51 — Remove unused #unfold
03:26:36 — Extract #parse_folded_structured_instruction helper
03:27:52 — Extract #parse_folded_plain_instruction helper
03:28:40 — Remove unused #parse_expression
03:30:19 — Thread a dummy identifier context through to #parse_normal_instruction
04:03:38 — Add `globals` index space to identifier context
04:18:13 — Add new globals to identifier context as they are parsed
04:20:59 — Look up global identifier in identifier context during parsing
04:22:14 — Replace association list of globals with array in interpreter
04:28:54 — Read global name directly from S-expression, not AST node
04:35:11 — Remove name from Global AST node
04:35:57 — Build initial identifier context from a copy of the module fields
05:00:31 — Add `functions` index space to identifier context
05:15:57 — Add function names to initial identifier context
05:16:28 — Look up function identifier in identifier context during parsing
05:16:55 — Parse table ID and limits in the correct order
05:24:05 — Thread the identifier context through to #parse_table
05:38:54 — Look up table elements in the identifier context
05:39:57 — Remove name from Function AST node
05:41:17 — Impelment Context#+ for combining two contexts
05:49:09 — Ignore nils when checking identifier contexts for well-formedness
05:56:33 — Make ID optional in #parse_global
05:59:24 — Use Context#+ to combine contexts in #build_initial_context
06:02:07 — Use #inject to combine contexts in #build_initial_context
06:04:17 — Use Hash#merge to implement Context#+ more generically
06:12:10 — Wrapping up
06:15:43 — Bye
Рекомендации по теме
visit shbcf.ru