Commit Graph

219 Commits

Author SHA1 Message Date
Scott Richmond
ce11f1cd0f start work on getting prelude working; discover closure bug 2025-06-21 17:43:47 -04:00
Scott Richmond
23d9945c48 fix if alternative unconditional jump len 2025-06-20 17:09:41 -04:00
Scott Richmond
92d0915a71 prelude compiles: WAT 2025-06-20 16:02:48 -04:00
Scott Richmond
b3e0af41bb constants need 16 bits 2025-06-20 15:56:13 -04:00
Scott Richmond
121861cc8e fix function scoping bug 2025-06-20 15:35:09 -04:00
Scott Richmond
a2ae53f8e4 wire up stub:w prelude from external file 2025-06-20 14:43:14 -04:00
Scott Richmond
e06a24cf20 base and stub prelude wired up 2025-06-20 14:30:39 -04:00
Scott Richmond
1e3fcde57a work on prelude; update tailcall to deal properly with base fns 2025-06-20 14:29:31 -04:00
Scott Richmond
c73c7e0d6a load base into a compiler 2025-06-20 12:53:16 -04:00
Scott Richmond
ef134c0335 fix argument order in base fns 2025-06-20 12:49:31 -04:00
Scott Richmond
e580d68809 recursion works, so does mutual recursion; function call bugfixes 2025-06-20 12:32:15 -04:00
Scott Richmond
f4ade4938c notes and todos 2025-06-20 00:56:43 -04:00
Scott Richmond
fa587e38cd fix binding bug 2025-06-20 00:33:25 -04:00
Scott Richmond
8b004b45fa find a bug in function bindings; TCO is maybe complete?; things are in a shambles 2025-06-19 21:47:58 -04:00
Scott Richmond
7e4ddd3dc4 improve panic traces; tail calls work for simpel calls 2025-06-19 21:13:18 -04:00
Scott Richmond
2f5dab84a7 tail calls work now? also print stack trace on panic 2025-06-19 20:52:19 -04:00
Scott Richmond
1af75bc516 fix upvalue resolution, start work on TCO 2025-06-19 20:29:15 -04:00
Scott Richmond
bf1e7e4072 rought draft of splatted fn args 2025-06-19 18:26:44 -04:00
Scott Richmond
442532ecd3 dict splatterns first draft 2025-06-19 15:56:23 -04:00
Scott Richmond
4dd4b8ff7e pseudocode splatted dict algo 2025-06-19 12:44:29 -04:00
Scott Richmond
35d7d3b1c8 first draft of tuple splatterns 2025-06-19 12:37:29 -04:00
Scott Richmond
a4d68fa02e first draft of list splatterns 2025-06-19 12:18:09 -04:00
Scott Richmond
2b95094eca first stab at splatted lists 2025-06-19 12:06:47 -04:00
Scott Richmond
4871dbd048 add match splatted list opcode 2025-06-19 11:54:26 -04:00
Scott Richmond
647f3d4463 update punch list 2025-06-19 11:48:50 -04:00
Scott Richmond
fb2488c850 rough draft of new version of loop w/ 16 bit jumps 2025-06-18 19:03:45 -04:00
Scott Richmond
f6bfe0975b update repeat w/ new jumps 2025-06-18 17:50:30 -04:00
Scott Richmond
ffe5d2ad61 panic on wrong number of args to functions 2025-06-18 16:47:53 -04:00
Scott Richmond
23298c8538 match now uses new jump; micro-optimize pop_n 2025-06-18 15:24:30 -04:00
Scott Richmond
77f1627132 update dict pattern for new jumps 2025-06-18 15:00:46 -04:00
Scott Richmond
6bd419125f update list pattern compiling to reflect new jump logic 2025-06-18 14:52:15 -04:00
Scott Richmond
a5f2e2a9bd tuple patterns now use jump_stub and patch_jump, with 16 bit jump values 2025-06-18 14:47:00 -04:00
Scott Richmond
a0ef6d2777 chip away at 16-bit jump instructions 2025-06-18 14:12:54 -04:00
Scott Richmond
d727096422 VM instructions now take 3 bytes 2025-06-18 14:12:10 -04:00
Scott Richmond
979afdbcb9 add jump fn for 16 bit jump 2025-06-18 13:15:57 -04:00
Scott Richmond
316e8a6a58 remove unused pattern.rs 2025-06-18 13:15:39 -04:00
Scott Richmond
e3b5b96dc2 test out 16 bit operand math 2025-06-06 00:11:08 -04:00
Scott Richmond
0347d10db7 first draft of complex string matching, discover jump mistake 2025-06-05 23:26:42 -04:00
Scott Richmond
77faf67191 fix InterpolatedPattern compilation 2025-06-05 21:23:08 -04:00
Scott Richmond
f8adaa7971 first draft of partial application, is working in easy cases 2025-06-05 16:45:23 -04:00
Scott Richmond
dee9bcfc33 start work on partial application, fix/abstract binding resolution 2025-06-05 16:10:40 -04:00
Scott Richmond
f3bf55fe72 add dict splats 2025-06-05 13:24:32 -04:00
Scott Richmond
b557c487cc add list splats 2025-06-05 13:05:07 -04:00
Scott Richmond
b8b720b877 add do forms 2025-06-05 12:15:49 -04:00
Scott Richmond
23b8beb291 fix extra pop regression 2025-06-05 12:04:02 -04:00
Scott Richmond
5ae4742840 save work, working on function clause guards, extra pop instructions are showing up after function definitions 2025-06-04 19:02:19 -04:00
Scott Richmond
0f8645d2eb guards work in match forms 2025-06-04 18:55:40 -04:00
Scott Richmond
01ce043379 guards work in match forms 2025-06-04 18:51:07 -04:00
Scott Richmond
2ce2e2c2d3 let as last expr in block now returns rhs; clean up some comment cruft 2025-06-04 18:27:17 -04:00
Scott Richmond
61b1b7bf90 closures work?! 2025-06-04 17:53:38 -04:00
Scott Richmond
bf2b16c30f add a print builtin/opcode 2025-06-03 19:26:01 -04:00
Scott Richmond
c497b90a16 implement multiterm synthetic expressions 2025-06-03 19:13:40 -04:00
Scott Richmond
fc245348b4 start pulling base fns into bytecode interpreter 2025-06-03 18:54:33 -04:00
Scott Richmond
615fef6ebc function calls: first draft, worked out the obvious bugs 2025-06-03 17:30:00 -04:00
Scott Richmond
86992078e9 keywords and interned strings use &'static str instead of indexes into vecs 2025-06-03 16:23:37 -04:00
Scott Richmond
681176282c basic function calls, still with bugs! 2025-06-03 15:48:13 -04:00
Scott Richmond
22d1ceb3e8 vm.chunk -> vm.callframe.chunk 2025-06-02 13:34:23 -04:00
Scott Richmond
de3d7e834c maybe properly compile functions? need to start work on fn calls to test 2025-06-01 20:01:42 -04:00
Scott Richmond
b6f9b35b4c start major work on function compilation 2025-05-30 17:02:55 -04:00
Scott Richmond
34ab24c4c9 add as patterns 2025-05-30 14:57:51 -04:00
Scott Richmond
cda217f6ef add string interpolation 2025-05-30 11:44:32 -04:00
Scott Richmond
82ac6744ca or and and are now reserved words 2025-05-28 16:37:25 -04:00
Scott Richmond
182b14e5f4 add builtins, fix basic synthetic expressions 2025-05-27 14:15:12 -04:00
Scott Richmond
74cc0025d6 first draft loop/recur, seems to work? 2025-05-26 11:03:37 -04:00
Scott Richmond
db7eb5965d return register now an 8-member array 2025-05-26 09:16:47 -04:00
Scott Richmond
1e1593298d update repeat 2025-05-26 08:32:33 -04:00
Scott Richmond
04c96c9edb dict patterns prolly work? one-level nested patterns work 2025-05-25 19:14:34 -04:00
Scott Richmond
45d2e7e742 rough, not yet working, draft of dict patterns 2025-05-25 19:09:21 -04:00
Scott Richmond
cf51822128 add list patterns, fix dict stack mechanics 2025-05-25 16:30:20 -04:00
Scott Richmond
4f7ba56d1f properly compile when expressions? 2025-05-23 17:59:09 -04:00
Scott Richmond
ce1612a30c compiler: decouple stack & bindings resetting 2025-05-23 13:43:35 -04:00
Scott Richmond
1ef0da5dd1 compiler: decouple stack & bindings resetting 2025-05-23 13:42:29 -04:00
Scott Richmond
4a4b2b22ed oh god, so many changes. working on tuple matching 2025-05-23 00:09:35 -04:00
Scott Richmond
6c803cdf5a take some loop notes 2024-12-27 00:54:31 -05:00
Scott Richmond
a7ee8f8e57 vm::run is now a loop, not vm::interpret as a tailcall 2024-12-27 00:47:22 -05:00
Scott Richmond
8908630a21 add match_depth to vm 2024-12-27 00:22:01 -05:00
Scott Richmond
6f582bff06 refactor if/else to match in guard compilation 2024-12-26 23:48:38 -05:00
Scott Richmond
f5965fdb44 compile guards in match forms 2024-12-26 23:46:06 -05:00
Scott Richmond
cfe0b83192 fix block compilation; compile & run repeat 2024-12-26 23:33:57 -05:00
Scott Richmond
4fa2ce5e78 separate compiler & chunk 2024-12-26 19:03:09 -05:00
Scott Richmond
40d4f48878 notes and comments 2024-12-26 18:41:54 -05:00
Scott Richmond
ef0ac40dbe working & thinking 2024-12-24 12:35:44 -05:00
Scott Richmond
a4f12c8f7d continue work on compiling functions 2024-12-23 10:55:28 -05:00
Scott Richmond
9f4e630544 get lifetime out of Chunk, thus out of Value 2024-12-22 19:51:02 -05:00
Scott Richmond
be23ee6c44 get simple match forms done 2024-12-22 19:33:59 -05:00
Scott Richmond
d943185db8 do lots of work 2024-12-22 19:07:42 -05:00
Scott Richmond
d4342b0623 get binding & pretty debugging working 2024-12-18 01:28:23 -05:00
Scott Richmond
48754f92a4 do work 2024-12-17 23:45:39 -05:00
Scott Richmond
096d8d00bc add untracked from opening bytecode branch 2024-12-15 23:50:12 -05:00
Scott Richmond
9c3205d4c1 DRY out validator, simplify code 2024-12-15 23:49:43 -05:00
Scott Richmond
6c78cffe56 finish list of valid types 2024-12-15 23:49:27 -05:00
Scott Richmond
35fc591c76 make some progress: atoms and ifs 2024-12-15 23:28:57 -05:00
Scott Richmond
eff2ed90d5 some simple bytecodes! 2024-12-15 17:54:40 -05:00
Scott Richmond
86aea78c21 start working on a bytecode interpreter! 2024-12-15 16:37:51 -05:00
Scott Richmond
d4af160f80 things & stuff 2024-12-14 13:43:08 -05:00
Scott Richmond
8535225167 fix print! 2024-12-13 13:47:03 -05:00
Scott Richmond
73e60b8ced bring full prelude into Ludus. 2024-12-12 19:43:56 -05:00
Scott Richmond
49a0b0f8a7 fix loop validation bugs 2024-12-12 19:28:55 -05:00
Scott Richmond
ac4bd0fb55 improve panic reports 2024-12-12 19:01:51 -05:00
Scott Richmond
273267f61d a slow and brute-force approach to the problem of re-binding closed-over forward declarations 2024-12-12 01:19:39 -05:00