Commit Graph

  • 54568ef1e4 Use definition allocator Andrew Morris 2022-05-12 09:27:01 +10:00
  • 605905fe7e Support variable declarations Andrew Morris 2022-05-11 22:29:39 +10:00
  • 0343c2bdc4 Implement referencing definitions and non-main function definitions Andrew Morris 2022-05-11 22:00:33 +10:00
  • ecc2b88a31 Start populating top-level scope Andrew Morris 2022-05-11 11:28:37 +10:00
  • fcce4bd15a wip scopes Andrew Morris 2022-05-11 11:00:08 +10:00
  • 5af8af20bd Add stubs for unimplemented declarations Andrew Morris 2022-05-11 09:38:49 +10:00
  • 51a76867c4 Implement empty statements Andrew Morris 2022-05-11 09:32:20 +10:00
  • 5c8ad46ef7 Add stubs for unimplemented statement types Andrew Morris 2022-05-11 09:30:25 +10:00
  • e94e30eafc Compile this expressions Andrew Morris 2022-05-11 09:25:29 +10:00
  • 3b23063b8b Implement paren expressions Andrew Morris 2022-05-11 09:08:37 +10:00
  • 8f4b2bd309 Split out ExpressionCompiler functions Andrew Morris 2022-05-11 09:04:32 +10:00
  • 70b67e083b Create ExpressionCompiler struct Andrew Morris 2022-05-11 08:54:48 +10:00
  • ba48082b39 Add unary+, unary- Andrew Morris 2022-05-11 08:41:00 +10:00
  • 6fb8ca3846 Compile unary operators Andrew Morris 2022-05-11 08:33:05 +10:00
  • a789a5d0ad Improve register utilization Andrew Morris 2022-05-06 13:09:53 +10:00
  • 2e8cca1b97 Avoid end instruction for return statements at the end of functions Andrew Morris 2022-05-06 12:19:24 +10:00
  • 0a1f75e8b3 Compile literals without necessarily putting them in registers Andrew Morris 2022-05-06 12:16:25 +10:00
  • 87f1ffbd11 Binary operators Andrew Morris 2022-05-06 11:38:42 +10:00
  • 87a7125d8a Support more literals Andrew Morris 2022-05-06 11:12:20 +10:00
  • 208697506a Enable running typescript Andrew Morris 2022-05-06 11:02:28 +10:00
  • 829f464bf2 Write to out.vsm Andrew Morris 2022-05-06 10:53:25 +10:00
  • 822d6db8cb Compile string literals Andrew Morris 2022-05-06 10:43:14 +10:00
  • 39bdc0eb52 Stub for compiling statements Andrew Morris 2022-05-06 10:07:01 +10:00
  • 218e546b8c Progress on compiling main function Andrew Morris 2022-05-06 09:34:29 +10:00
  • fb75bcf0f1 Name allocations Andrew Morris 2022-05-06 08:46:13 +10:00
  • b11ea2abdc Get down to main_fn Andrew Morris 2022-05-06 08:09:03 +10:00
  • b872165e2f wip compiler Andrew Morris 2022-05-06 08:01:17 +10:00
  • 40a990590c Add compile stub Andrew Morris 2022-05-06 07:20:06 +10:00
  • 6e1a14243d Enable typescript parsing Andrew Morris 2022-05-06 07:08:31 +10:00
  • 0bfc29aadf Add optional chaining and bitwise operators Andrew Morris 2022-05-04 18:17:43 +10:00
  • 48a2cf64a1 Fix strings Andrew Morris 2022-05-04 16:44:15 +10:00
  • a9fb05e316 Handle unicode correctly when assembling Andrew Morris 2022-05-04 16:11:21 +10:00
  • ab4d163e00 Add FIXME Andrew Morris 2022-05-04 14:29:17 +10:00
  • f17f83f649 Implement (basic) subscripting Andrew Morris 2022-05-04 14:13:37 +10:00
  • 5501720285 Minor fix Andrew Morris 2022-05-04 12:39:20 +10:00
  • b38498853c decode objects Andrew Morris 2022-05-04 12:35:33 +10:00
  • 869f026948 Add remaining operations as panic stubs Andrew Morris 2022-05-04 12:17:31 +10:00
  • 12347f2f4f Add typeof Andrew Morris 2022-05-04 12:09:17 +10:00
  • f770049aee More operators Andrew Morris 2022-05-04 11:53:48 +10:00
  • cb1cf4cc76 Scaffolding for operations Andrew Morris 2022-05-04 11:39:09 +10:00
  • a94d4313b7 Simplify with apply_binary_op, add more operations Andrew Morris 2022-05-04 11:33:12 +10:00
  • 15133bd4f1 Prefer moving Vals instead of passing by reference Andrew Morris 2022-05-04 10:52:04 +10:00
  • 44e8392248 Implement bind Andrew Morris 2022-05-04 10:38:28 +10:00
  • ba048e3c56 Add stubs for all vm instructions Andrew Morris 2022-05-04 08:54:13 +10:00
  • 2f74466d70 Add project euler problem 2 solution Andrew Morris 2022-05-03 21:18:17 +10:00
  • aa3f18ed20 Refactor Val to an enum Andrew Morris 2022-05-03 21:04:36 +10:00
  • fd71d6f08c Implement apply Andrew Morris 2022-05-03 17:07:46 +10:00
  • f387bdd396 Support decoding all instructions Andrew Morris 2022-05-03 16:54:14 +10:00
  • fa64b907e2 Support undefined + null literals in vm Andrew Morris 2022-05-03 13:00:48 +10:00
  • c09ca141f1 Get factorial working Andrew Morris 2022-05-03 12:38:33 +10:00
  • 1509f7f9fb Implement call instruction Andrew Morris 2022-05-03 12:28:36 +10:00
  • 5d40ed552b Enable running based on file extension Andrew Morris 2022-05-03 11:22:08 +10:00
  • 30e5a728e2 Use special startup frame to remove branch Andrew Morris 2022-05-03 10:51:04 +10:00
  • 667a3ba398 Fix OpInc Andrew Morris 2022-05-02 16:24:26 +10:00
  • 78cacc3372 Add VsBool and jump instructions Andrew Morris 2022-05-02 16:11:25 +10:00
  • b5f1cc7b78 Add is_truthy Andrew Morris 2022-05-02 16:03:03 +10:00
  • 93f338bbc4 Enable decoding registers Andrew Morris 2022-05-02 16:00:41 +10:00
  • 35e0dd3688 Add more binary operators Andrew Morris 2022-05-02 15:51:05 +10:00
  • a507b65745 projEuler1.vsm Andrew Morris 2022-05-02 15:50:50 +10:00
  • c798a36382 Fixes to run the very first program: 5+7 -> 12 Andrew Morris 2022-05-02 15:23:55 +10:00
  • 9af2274246 wip vm::run Andrew Morris 2022-05-02 15:17:33 +10:00
  • 74c442ffea Pass bytecode directly to vm::run Andrew Morris 2022-05-02 12:50:33 +10:00
  • 1912c8282f Add vs_function Andrew Morris 2022-05-02 12:39:05 +10:00
  • 25b7c67698 Enumerate all possibilities in decode_val Andrew Morris 2022-05-02 12:21:05 +10:00
  • 4c18613747 to_primitive Andrew Morris 2022-05-02 12:12:07 +10:00
  • 4e58b7a269 Split out vs_number, vs_string, vs_pointer, operations Andrew Morris 2022-05-02 11:50:16 +10:00
  • 3593f1c710 virtual_machine submodule Andrew Morris 2022-05-02 11:33:45 +10:00
  • 212fc58cf9 Move backpointer check into BytecodeDecoder Andrew Morris 2022-05-02 11:22:23 +10:00
  • 56b4676fbd Add VsPointer Andrew Morris 2022-05-02 11:14:23 +10:00
  • ae42cfc6d8 Fixes, decode_string Andrew Morris 2022-05-02 09:39:15 +10:00
  • 9c5fa69b4c wip pointers/bytecode Andrew Morris 2022-05-01 19:03:23 +10:00
  • 89efce6cd3 parallelFindIndex.ts Andrew Morris 2022-05-01 18:03:29 +10:00
  • ac295889f5 Add concurrencyLimit to parallelMap Andrew Morris 2022-05-01 17:58:36 +10:00
  • ebd7bf49fe Get addition working Andrew Morris 2022-05-01 11:03:51 +10:00
  • ed748cbd70 vs_value Andrew Morris 2022-05-01 10:47:20 +10:00
  • f6f8c435e1 Add concept code for thread Andrew Morris 2022-04-30 14:58:25 +10:00
  • 0b729f0168 Add stub for virtual_machine Andrew Morris 2022-04-28 20:23:26 +10:00
  • a7f1843994 cli stub for vstc run Andrew Morris 2022-04-28 19:57:48 +10:00
  • 125a4885ad Replace write_unresolved_definition Andrew Morris 2022-04-27 23:14:50 +10:00
  • c3895f164e Implement labels Andrew Morris 2022-04-27 23:12:52 +10:00
  • 371f934a18 LocationMap Andrew Morris 2022-04-27 22:08:52 +10:00
  • a031d046ff Prefer usize Andrew Morris 2022-04-27 21:51:34 +10:00
  • 3cd3e6f946 AssemblerFnData Andrew Morris 2022-04-27 21:43:39 +10:00
  • 6062e13022 Fix object commas Andrew Morris 2022-04-26 23:02:29 +10:00
  • 9d78681bf6 Allow definitions to be any value Andrew Morris 2022-04-26 22:50:08 +10:00
  • 3392c96114 Add strings and objects Andrew Morris 2022-04-26 22:48:18 +10:00
  • 1e60b88cf4 Update bytecode example Andrew Morris 2022-04-26 21:33:19 +10:00
  • e910f66475 Fill in unresolved definitions Andrew Morris 2022-04-26 21:28:39 +10:00
  • b9cf50f6f4 Implement register mapping Andrew Morris 2022-04-26 18:42:44 +10:00
  • 676ad28cc0 Use ff for ignore register Andrew Morris 2022-04-26 18:12:46 +10:00
  • 93478875ba Remove debug logs Andrew Morris 2022-04-26 17:55:12 +10:00
  • c1c7084a1a Write instructions Andrew Morris 2022-04-26 17:47:52 +10:00
  • 0c546de59d Update sample annotated bytecode for array=0x09 Andrew Morris 2022-04-26 17:45:00 +10:00
  • 66a1e4afee assemble_number and values that use keywords Andrew Morris 2022-04-26 17:37:59 +10:00
  • 0d8eda237b wip assembling instructions Andrew Morris 2022-04-26 16:53:16 +10:00
  • b0e4a13602 get_instruction_layout Andrew Morris 2022-04-26 16:14:53 +10:00
  • a791329f51 Refactor to object oriented assembler Andrew Morris 2022-04-26 15:47:48 +10:00
  • 44a8aa80c8 Assemble a complete example (skipping most of it) Andrew Morris 2022-04-26 15:00:13 +10:00
  • 3a2d2f5821 Fix compiler errors that didn't show in vs code hmph Andrew Morris 2022-04-26 13:00:15 +10:00
  • a7a2d71383 parse_instruction_word Andrew Morris 2022-04-26 12:47:21 +10:00