Commit Graph

423 Commits

Author SHA1 Message Date
cbd78ce7f7 Get parser combinator strategy working 2023-05-16 16:06:18 -04:00
919ab5ca34 Keep grinding on parser combinators 2023-05-07 23:23:42 -04:00
5b1ff5aef3 Many iterations of parser combinator strategies. Not yet working. 2023-05-07 22:49:19 -04:00
2866ff4eb6 Make some modest moves 2023-05-02 19:44:17 -04:00
c5a72912df Dequalify token keywords 2023-05-02 19:43:57 -04:00
963c63aed3 Unwire the things for parser refactor 2023-05-02 19:15:05 -04:00
96b3f01e7e keep unfucking merge 2023-05-02 19:07:21 -04:00
4936daa8dc dequalify token keywords 2023-05-02 19:02:28 -04:00
3a7f86e401 Clean up some stuff, add ebnf grammar, fail to get quil working 2023-05-02 18:58:36 -04:00
0c2c646012 Clean up some stuff in scanner, try and fail to get quil working 2023-05-02 18:55:56 -04:00
Scott Richmond
55d76f6854 proof of concept: add quil to ludus 2023-03-25 15:52:25 -04:00
Scott Richmond
1c2ab5182e futz with repl 2023-03-20 15:36:00 -04:00
Scott Richmond
7dca7ad3cc add a quick thought about spawn implementation 2023-01-28 17:42:34 -05:00
Scott Richmond
ccddfa07c5 add reference to vthread source 2023-01-28 17:42:17 -05:00
Scott Richmond
b7f0d17afe processes use virtual threads 2023-01-28 17:18:09 -05:00
Scott Richmond
a51ba2a2bc add TODO re: expression terminators 2023-01-28 14:31:40 -05:00
Scott Richmond
1caddfacbc Make (_) a parsing error 2022-11-03 17:51:33 -04:00
Scott Richmond
e248be16cf Comment out <- from scanner 2022-11-03 17:33:06 -04:00
Scott Richmond
01d7dc0ab1 Fix bug where if let leaked context 2022-11-03 17:19:46 -04:00
Scott Richmond
238910e68e Complete single-branch datatypes, start work on sum types 2022-08-04 19:24:09 -04:00
Scott Richmond
cd0cad8ac3 cljfmt 2022-08-04 18:45:56 -04:00
Scott Richmond
9684c2f4c5 Add datatype declarations 2022-08-04 18:43:20 -04:00
Scott Richmond
5300ca5e3b Move ns & import to parse-script 2022-08-04 16:54:13 -04:00
Scott Richmond
969c321ffb Work on datatypes 2022-08-04 16:49:20 -04:00
Scott Richmond
18e4826960 Add datatype tokens 2022-07-26 18:25:11 -04:00
Scott Richmond
72aac19bd7 Add upper? and lower? fns 2022-07-26 18:19:16 -04:00
Scott Richmond
88c79b2b31 Comment out REPL cruft 2022-07-26 18:18:57 -04:00
Scott Richmond
08d91dd9de Add useful TODO, re: tuple splat patterns 2022-06-25 22:01:32 -04:00
Scott Richmond
272e46551e Cleanup todos 2022-06-25 18:20:54 -04:00
Scott Richmond
d2cefb79f0 Fix bug allowing repeated names everywhere 2022-06-25 18:18:54 -04:00
Scott Richmond
80fe4d370d Prevent duplicate keys in struct/dict patterns 2022-06-25 11:55:17 -04:00
Scott Richmond
df511ce5eb Fix bug allowing repeated name in tuples 2022-06-19 16:21:54 -04:00
Scott Richmond
a56a4b565a ::ast/splatted -> ::ast/splat (standardize) 2022-06-19 16:21:12 -04:00
Scott Richmond
e30a8b973b Add splats to dict & struct patterns in parser 2022-06-19 15:46:58 -04:00
Scott Richmond
07c21494cf Add splats to tuple patterns in parser 2022-06-19 15:01:00 -04:00
Scott Richmond
24f85966a2 Improve error message. 2022-06-19 14:58:14 -04:00
Scott Richmond
cdfcd1249e Fix copypasta error 2022-06-19 14:57:44 -04:00
Scott Richmond
c3c5c390e5 Unroll copypasta. 2022-06-19 14:57:04 -04:00
Scott Richmond
4e7590226b Copypasta splat patterns to dict, struct, tuple in parser 2022-06-19 14:52:38 -04:00
Scott Richmond
68bc37ef61 Add splats to list patterns in parser 2022-06-19 14:48:53 -04:00
Scott Richmond
4254359934 Complete if-let 2022-06-19 14:01:55 -04:00
Scott Richmond
689f3f23bc Add interpret-if-let 2022-06-19 13:46:11 -04:00
Scott Richmond
ed14b97a00 REPL investigate if-let ast 2022-06-19 13:45:52 -04:00
Scott Richmond
5653912f0e Fix file loading from REPL 2022-06-19 13:34:16 -04:00
Scott Richmond
f8322412b7 Remove REPL stuff 2022-06-19 13:15:00 -04:00
Scott Richmond
61bdeab5a6 REPL stuff 2022-06-19 13:12:50 -04:00
Scott Richmond
c17d210b43 Fix scanning bug: = is now a terminator 2022-06-04 14:49:49 -04:00
Scott Richmond
0aa7efcbb1 Add process:flush, fix printing 2022-06-02 19:10:41 -04:00
Scott Richmond
8752ee0da1 Add some process functions 2022-06-02 18:42:02 -04:00
Scott Richmond
4603dcf980 Fix import+process bug 2022-06-02 17:51:30 -04:00
Scott Richmond
2de1d94a4a Fix unbound name errors, import bug, process:in->process:inbox 2022-06-02 17:38:16 -04:00
Scott Richmond
2f5ebe85f7 Improve error messages in processes 2022-06-02 14:57:16 -04:00
Scott Richmond
1123d82503 Add conj and assoc 2022-06-02 14:56:13 -04:00
Scott Richmond
015d079d57 hashmap->dict cleanup 2022-06-02 14:56:03 -04:00
Scott Richmond
3f44c64802 Fix tuple/list/set parsing bug 2022-06-01 18:00:29 -04:00
Scott Richmond
b249817aa9 Fix print-function stack overflow 2022-06-01 17:28:55 -04:00
Scott Richmond
46581e103d Add actors to repl 2022-06-01 10:44:34 -04:00
Scott Richmond
1e28556baa First stab at 'actors': using threads. 2022-05-31 14:21:19 -04:00
Scott Richmond
09696c212a Fix bug when last line is comment 2022-05-31 14:12:52 -04:00
Scott Richmond
0055056142 Parse receive & self 2022-05-30 18:02:24 -04:00
Scott Richmond
b0d5b30124 Parse spawn & send 2022-05-30 17:40:27 -04:00
Scott Richmond
bb1f2a0086 Fix botched reserved word update 2022-05-30 17:24:10 -04:00
Scott Richmond
33d12898ec Clean up reserved words 2022-05-30 17:20:57 -04:00
Scott Richmond
18bcf6d8c6 More minor repl improvements 2022-05-27 20:02:32 -04:00
Scott Richmond
173f5756a7 cljfmt 2022-05-27 19:18:00 -04:00
Scott Richmond
874dacf791 Littl repl improvements 2022-05-27 19:09:25 -04:00
Scott Richmond
a57446db93 Add basic repl session management 2022-05-26 20:24:41 -04:00
Scott Richmond
059fc16df2 Stand up super basic repl 2022-05-26 19:50:55 -04:00
Scott Richmond
698a07d085 Add interpret-repl 2022-05-26 19:50:45 -04:00
Scott Richmond
ef97cf16e4 Baby repl stub 2022-05-26 18:59:28 -04:00
Scott Richmond
a3c60e0196 Hashmap -> dict in scanner 2022-05-26 18:54:51 -04:00
Scott Richmond
64c8f30964 Hashmap -> dict in parser 2022-05-26 18:49:52 -04:00
Scott Richmond
3292c0676c Hashmap -> dict 2022-05-26 18:44:40 -04:00
Scott Richmond
a5b1763324 Add import error handling 2022-05-26 18:40:26 -04:00
Scott Richmond
8f1701dabb Add minimal error handling 2022-05-26 18:39:37 -04:00
Scott Richmond
7beca7e0f6 Fix line number reporting 2022-05-26 18:12:23 -04:00
Scott Richmond
c5a7b5ad46 Add a little comment 2022-05-26 18:06:37 -04:00
Scott Richmond
907d4e2b31 Use the little file loader 2022-05-24 18:52:45 -04:00
Scott Richmond
d8d1bf0858 Make a little file loader 2022-05-24 18:52:32 -04:00
Scott Richmond
0887c0d830 Comment out repl stuff 2022-05-24 17:32:17 -04:00
Scott Richmond
3798dba9dc Comment out repl stuff 2022-05-24 17:31:52 -04:00
Scott Richmond
6cced0dd8a Tidy up 2022-05-24 17:30:38 -04:00
Scott Richmond
372103a3ee Add or and and 2022-05-24 17:29:06 -04:00
Scott Richmond
1ca434b308 Remove old show cruft 2022-05-24 17:02:50 -04:00
Scott Richmond
c0e88021f2 Remove unused clojure/string require 2022-05-24 17:02:09 -04:00
Scott Richmond
1079bb8028 Remove unused (and incorrect) 2-arity of token fn 2022-05-24 17:01:44 -04:00
Scott Richmond
b1284f3338 Interpret splats in sets 2022-05-20 19:01:13 -04:00
Scott Richmond
6e4fd22fd4 Pull #()s out into fns 2022-05-20 18:54:14 -04:00
Scott Richmond
355b9f9949 Remove println crud 2022-05-20 18:50:43 -04:00
Scott Richmond
f0fe8005e9 Interpret splats in hashmaps 2022-05-20 18:46:40 -04:00
Scott Richmond
f70aa0f4ce Parse splats in hashmaps *correctly* 2022-05-20 18:46:24 -04:00
Scott Richmond
ea5d9fa948 Parse splats in hashmaps and sets 2022-05-20 18:14:22 -04:00
Scott Richmond
7390461f2b Interpret list splats 2022-05-20 17:59:39 -04:00
Scott Richmond
9d645e3b4b Add list splats 2022-05-20 17:35:16 -04:00
Scott Richmond
bb3d145e5d Fiddle repl source 2022-05-20 17:35:02 -04:00
Scott Richmond
4d7b12eb34 Add struct patterns 2022-05-19 20:03:39 -04:00
Scott Richmond
34da4dd6fe Actually add hashmap patterns. Whoops. 2022-05-19 20:00:16 -04:00
Scott Richmond
bc2f6f8317 REPL cruft 2022-05-19 19:59:40 -04:00
Scott Richmond
bd9a408e07 Add hash patterns; add hashmap data tag & update show 2022-05-19 19:59:20 -04:00
Scott Richmond
9984a6c8ec Add basic list matching 2022-05-19 19:27:32 -04:00
Scott Richmond
a899ee776d Parse basic list, hash, struct patterns. 2022-05-19 19:14:25 -04:00
Scott Richmond
ad778f7104 Play around 2022-05-19 18:55:38 -04:00
Scott Richmond
35cbe352a8 Update reserved words list & impl 2022-05-19 18:55:27 -04:00
Scott Richmond
9dd963e5b2 Interpret panic! not as fn but as rw. 2022-05-19 18:12:55 -04:00
Scott Richmond
4aeaa9e889 Fix parse-list :token typo 2022-05-19 18:11:31 -04:00
Scott Richmond
bd09dfa459 Remove panic! from prelude 2022-05-19 18:01:20 -04:00
Scott Richmond
4966271aa3 Parse panic! 2022-05-19 18:00:31 -04:00
Scott Richmond
1415461876 Fix panic! keyword 2022-05-19 18:00:18 -04:00
Scott Richmond
a36920e97e Add panic! reserved word 2022-05-19 17:54:10 -04:00
Scott Richmond
62a0fa2429 Add additional asts to errors. 2022-05-19 17:53:22 -04:00
Scott Richmond
8d2993637e Missed an ast add; fix it 2022-05-19 17:16:12 -04:00
Scott Richmond
cfe790b9c5 Add asts to thrown errors. 2022-05-19 17:14:20 -04:00
Scott Richmond
1fb41d8b71 Add tokens (and thus locations) to all AST nodes 2022-05-19 16:58:38 -04:00
Scott Richmond
ee4438bf1e Testing, small typo fix 2022-05-19 16:58:13 -04:00
Scott Richmond
959927f7ce Play with circular refs around closures 2022-05-19 16:17:30 -04:00
Scott Richmond
f419c390af Update reserved words list & impl 2022-05-19 16:16:55 -04:00
Scott Richmond
0939304518 Add TODO, re: closures 2022-05-18 20:45:14 -04:00
Scott Richmond
5a72125d1f Testing/playing 2022-05-18 20:30:27 -04:00
Scott Richmond
3b5e91c1bb Fix closure bug. 2022-05-18 20:23:43 -04:00
Scott Richmond
a5914076b0 Interpret loop/recur 2022-05-18 19:35:41 -04:00
Scott Richmond
b62fa6d074 Fix off-by-paren loop tup bug 2022-05-18 19:35:30 -04:00
Scott Richmond
0b7687024f Comment out testing 2022-05-18 18:33:32 -04:00
Scott Richmond
362e76c323 Parse loop/recur, and reindent all the things 2022-05-18 18:32:57 -04:00
Scott Richmond
e7eccca000 Update reserved words list & impl 2022-05-18 18:32:34 -04:00
Scott Richmond
5c07f43713 pprint refs 2022-05-18 18:32:15 -04:00
Scott Richmond
9df37cca4d Remove circular dependency 2022-05-18 18:31:35 -04:00
Scott Richmond
fb89508bef Play with base ref forms 2022-05-18 18:31:11 -04:00
Scott Richmond
8cbc516a66 Native ref fns 2022-05-17 19:13:13 -04:00
Scott Richmond
b1022ad832 Interpret refs 2022-05-17 19:13:00 -04:00
Scott Richmond
b0212b7e41 Parse refs 2022-05-17 18:34:07 -04:00
Scott Richmond
4c7ed5a8ef Update reserved words list 2022-05-17 17:30:33 -04:00
Scott Richmond
91cb0126fc Revert "clj -> cljc"
This reverts commit 214e94465d.
2022-04-30 14:08:04 -04:00
Scott Richmond
082cf9c78c rm cljs 2022-04-30 13:57:25 -04:00
Scott Richmond
214e94465d clj -> cljc 2022-04-30 13:56:14 -04:00
Scott Richmond
3d2c4719a6 Set up for GraalVM native-image 2022-04-28 19:27:35 -04:00
Scott Richmond
3c51394278 run uses show as printer, not pprint 2022-04-25 20:37:29 -04:00
Scott Richmond
cf7e739a93 delete cruft 2022-04-25 20:37:08 -04:00
Scott Richmond
19a0e7e3d5 Factor show out to its own package. 2022-04-25 20:21:23 -04:00
Scott Richmond
6f16495aab Improve ns access error message 2022-04-25 19:23:32 -04:00
Scott Richmond
6d81175b37 Wrap interpret in try/catch for more graceful panics 2022-04-25 19:08:05 -04:00
Scott Richmond
f7809d5ddf Improve panic message reporting 2022-04-25 19:07:18 -04:00
Scott Richmond
9cd4fccfb9 Remove comment cruft 2022-04-25 19:06:30 -04:00
Scott Richmond
8a36b1e4e2 Comment out testing 2022-04-25 18:46:12 -04:00
Scott Richmond
0c77de908c Make context volatile!, not atom 2022-04-25 18:44:44 -04:00
Scott Richmond
ceb8a2aa63 Make test for keyword more robust 2022-04-11 13:08:40 -04:00
Scott Richmond
2f6e81edb1 Add a quick TODO; interpret-import in progress 2022-04-08 20:48:09 -04:00
Scott Richmond
3749d2ea50 Very first draft of import expression 2022-04-08 19:13:57 -04:00
Scott Richmond
fd832ac38e Allow _ as else in cond 2022-04-08 18:26:36 -04:00
Scott Richmond
969bbc548f Parse import statements 2022-04-08 15:59:47 -04:00
Scott Richmond
9dc9e95e85 Parse ignored words as placeholder 2022-04-08 15:23:08 -04:00
Scott Richmond
be2d291fd3 Interpret ns 2022-04-07 18:51:48 -04:00
Scott Richmond
9eecce77bc Fix ns name bug 2022-04-07 18:47:05 -04:00
Scott Richmond
df59b84321 Comment out testing 2022-04-07 18:31:36 -04:00
Scott Richmond
1317e52bbf Parse ns 2022-04-07 18:31:13 -04:00
Scott Richmond
ac83d3070b Update keyword impls 2022-04-07 18:09:53 -04:00
Scott Richmond
917e4f7ab5 Interpret cond; allow else in cond & match 2022-04-06 19:41:36 -04:00
Scott Richmond
03713c67bc Parse cond 2022-04-06 19:21:49 -04:00
Scott Richmond
e6419f6b6a Comment out testing 2022-04-05 20:31:46 -04:00
Scott Richmond
d8e8a1b17e Interpret partially applied functions 2022-04-05 20:27:22 -04:00
Scott Richmond
7309622a2b :partially-applied -> :partial 2022-04-05 20:27:04 -04:00
Scott Richmond
0544a44758 Actually comment out testing 2022-04-05 19:47:38 -04:00
Scott Richmond
bee8c250d4 Parse partial-application placeholder 2022-04-05 19:46:44 -04:00
Scott Richmond
fa5e51a179 Change some testing stuff 2022-04-05 19:11:44 -04:00
Scott Richmond
5a95f58ec1 Interpret do expressions 2022-04-05 19:09:38 -04:00
Scott Richmond
0a34e22a98 Remove debug pps 2022-04-05 19:09:22 -04:00
Scott Richmond
89f813c2f3 Parse do expressions/pipelines 2022-04-05 15:54:28 -04:00
Scott Richmond
174eb2d6a5 Pipeline is now >; add helpful impl comments 2022-04-05 15:54:12 -04:00
Scott Richmond
8cd905b8eb Test around panics. 2022-04-04 19:08:19 -04:00
Scott Richmond
d663f48b6f Remove panic! keyword (it's an fn) 2022-04-04 19:07:33 -04:00
Scott Richmond
bf8e1d1924 Fix prelude/print bug 2022-04-03 22:23:12 -04:00
Scott Richmond
aa3692a141 Get rid of core shadow warnings. 2022-04-03 22:20:31 -04:00
Scott Richmond
e0161372e3 Wire up CLI. 2022-04-03 20:48:22 -04:00
Scott Richmond
12487b390e Remove testing cruft 2022-04-03 20:11:23 -04:00
Scott Richmond
69118ed4e0 Use ex-info everywhere 2022-04-03 20:08:28 -04:00
Scott Richmond
b8e7777841 Called KW enforce one arg 2022-04-03 19:13:54 -04:00
Scott Richmond
f93eacf5f5 Fix keyword function calling 2022-04-03 17:03:22 -04:00
Scott Richmond
7a4034d920 Keywords can be called as passed fns 2022-04-03 15:39:41 -04:00
Scott Richmond
9fd69b57f3 Don't throw in test code 2022-04-03 14:49:20 -04:00
Scott Richmond
31d407c181 Interpret structs 2022-04-03 14:48:23 -04:00
Scott Richmond
7c4751dda8 Actually scan structs. 2022-04-03 14:48:08 -04:00
Scott Richmond
21af8acf2e Parse structs 2022-04-03 14:34:30 -04:00
Scott Richmond
6b9fc590a6 Add struct to parse-expr 2022-04-03 14:25:14 -04:00
Scott Richmond
33a086b312 Copy-paste struct parse from hashmap 2022-04-03 14:24:28 -04:00
Scott Richmond
811a57be1c Add struct to scanner; new reserved words. 2022-04-03 14:22:01 -04:00
Scott Richmond
98530b0f0f Add a static analysis note 2022-03-20 20:15:51 -04:00
Scott Richmond
41e9b4d9dd Some light speed testing: Ludus is 1000x slower than Clojure. 2022-03-20 20:15:43 -04:00
Scott Richmond
52f357765d Light cleanup 2022-03-20 19:39:01 -04:00
Scott Richmond
b7d49cbf5d Test recursion. It works! 2022-03-20 19:35:41 -04:00
Scott Richmond
272951a411 Add several functions to the prelude 2022-03-20 19:35:29 -04:00
Scott Richmond
3f8207fa41 Add ns for ludus data 2022-03-20 19:35:16 -04:00
Scott Richmond
9ce1f29977 Update notes 2022-03-20 19:25:20 -04:00
Scott Richmond
b5a5be9dd0 Change tuple representation 2022-03-20 19:21:55 -04:00
Scott Richmond
d02bc05209 Finally: add functions! 2022-03-20 19:17:15 -04:00
Scott Richmond
3b1f2460a8 Write basic test case 2022-03-20 18:32:31 -04:00
Scott Richmond
1f19a0ea1e Decide against refactoring beyond cljfmt, write basic fn parser 2022-03-20 18:30:30 -04:00
Scott Richmond
bfef7a8e66 cljfmt all the things 2022-03-20 17:58:38 -04:00
Scott Richmond
5da8090d2b Reindent things; start work on named fns; decide to refactor things 2022-03-20 17:37:44 -04:00
Scott Richmond
0f64307ba8 Add happy path for anon simple fns 2022-03-20 17:01:21 -04:00
Scott Richmond
3fde297e07 Import prelude 2022-03-20 16:41:02 -04:00
Scott Richmond
14b6e31081 Move prelude functions out to prelude ns 2022-03-20 16:40:50 -04:00