Commit Graph

91 Commits

Author SHA1 Message Date
a038a8cebf Ensure proper env care during memo short circuiting 2023-01-31 22:54:53 -05:00
967ec0feb4 After too much procrastination trying a bunch of parentheses editing plugins (parinfer the most interesting), did a bit of actual work and refactoring where the compiled function is checked for and inserted using both the pre and post partial-eval hash, and the analysis functions are pulled out together into a single meta analysis 2023-01-31 00:59:16 -05:00
c20ba09179 clean up compile more, going straight to pulling out of memo, removing compile-body-part, removing now-unecessary recursion checking (for ping-pong between partial-eval and compile-inner because of how we now check memo and normalize), and finally add all tests to new_test.sh 2023-01-25 02:22:10 -05:00
7f9f419a23 Remove rest of comb rec_hash tracking 2023-01-22 00:41:29 -05:00
5a4cb4b40b Cleanup, remove some of the rec_hashes 2023-01-22 00:07:39 -05:00
dff6730dd9 Got partial-eval during compile working 2023-01-21 17:55:55 -05:00
b2f0b5f1dd Notes on todo 2023-01-16 18:55:52 -05:00
54f1092a2a Old sketches, start simpler benchmarks setup with Koka WASM 2023-01-16 15:32:45 -05:00
Nathan Braswell
8638086480 Added ability to turn off 4 major optimizations, integrated into benchmarks now focused only on Kraken (and NewLisp) 2022-11-10 02:10:56 -05:00
Nathan Braswell
7eb8465f64 First maybe working version of borrow?. Now need to figure out exactly how to integrate into compiler 2022-07-19 23:42:24 -04:00
Nathan Braswell
e95feb9309 tiny perceus fix, but mostly wrote match+rb-tree f-expr/macro for newLisp and benchmarked it. kraken 5-15x faster than newlisp-rbtree-macro, 137x faster than newlisp-rbtree-fexpr. I was suprised at first that the macro and fexpr versions were so close at 8.7x (while interpreted kraken rbtree is 50,000x slower), but after thinking about it it makes sense - the Kraken version has slowdown exponential in the multiple levels of f-exprs ('match' is an fexpr, but then so is 'let' and 'and' and 'lambda'), whereas the newLisp f-expr runtime expands to fast builtins ('let', 'and', etc). And all that exponential f-expr slowdown gets compiled away in Kraken! 2022-07-06 02:34:48 -04:00
Nathan Braswell
2cdfa4dbed Mostly sketch out borrow?, just have to thread through perceus data and figure out if we want to output a combined version to the user with a common entry point. Fixed a pseudo-perceus cond ordering issue as well, and now makes pseudo-perceus store if a symbol access is an owning sink - but this has a bug somewhere in Pseudo-Perceus causing this to error for now 2022-07-05 02:51:48 -04:00
Nathan Braswell
131824b230 First impl of Pseudo-Perceus, added veval case to infer_types, modified how lookups work on s_env, now lookups into enclosing envs don't reify current environments by starting at the outer env after climbing out of the inlined functions + main function 2022-07-05 01:41:58 -04:00
Nathan Braswell
15bf38db2b Implement the first scaffolding for pseudo_perceus, support operatives in lapply (but not yet applicates in compiled vapply). Means (foldl and true (array true true false)) actually works now, for the paper! 2022-07-04 00:47:17 -04:00
Nathan Braswell
a64c67571f small refactor around parameter array creation, then used it to inline calls to 'array' (which are almost no-ops, just returning their parameter array) 2022-07-03 20:29:53 -04:00
Nathan Braswell
ace81e362e Inline array? and len, add PicoLisp fib & fib-let benchmarks 2022-07-02 23:49:47 -04:00
Nathan Braswell
07a25c8c59 Infer types of full idx expressions now, fix bug with shadowed inlined parameters, inline calls to idx where the type of the indexed expression is fully inferred (array+len) and the idx is a constant. Strong speedups 2022-07-02 19:00:20 -04:00
Nathan Braswell
b70e317e75 Fixed it! Missed converting the inline call to the inline predicate to use id instead of env. Then exposed and fixed bugs with the inline part of infer types 2022-07-02 17:10:16 -04:00
Nathan Braswell
9edfddd09c Partial commit for debugging - almost have (maybe do have?) the type inference working (everything but asserts) good enough for idx, but somewhere inlining got messed up and nothing's inlining. 2022-07-02 16:55:12 -04:00
Nathan Braswell
f6b4231fca Bugfix, improve, and thread through infer_types. Need to improve so that it can properly work & re-up through unval-and-eval. Also, will need to track idxs into symbols, I think. Need to continue to investigate how match is translated and that we get all types from it 2022-07-02 01:23:14 -04:00
Nathan Braswell
88a87f0760 Implement a good bit of the type inference (predicate ops, 'and', and len type inference). Need to implement combine_type_map, and figure out the structural caching 2022-06-30 00:59:04 -04:00
Nathan Braswell
999d21746e inline dup and most of drop, relative added to benchmarks, added first basic run (without any of the complex stuff implemented) of local type inference and use it to do word value equality if possible 2022-06-27 01:48:07 -04:00
Nathan Braswell
71ad070922 inline get_ptr with slightly more efficiency 2022-06-24 00:39:10 -04:00
Nathan Braswell
ae320ba31b Most things seem to be working now, with new benchmarks. Not sure if a small memory leak is now or was there before 2022-06-23 01:00:27 -04:00
Nathan Braswell
04f3b2dbd9 Fixed static type errors, test runs now. Rbtree test has a dynamic indirect call failure, so there are still more issues to find 2022-06-22 14:04:56 -04:00
Nathan Braswell
1c3ee27547 More fixes, runs test now, but generated wasm has type errors 2022-06-22 01:43:04 -04:00
Nathan Braswell
6605050590 More bugfixes and debugging 2022-06-22 01:26:21 -04:00
Nathan Braswell
bf8d25e551 Fix a bunch of syntax errors 2022-06-22 00:46:35 -04:00
Nathan Braswell
b665877add Finish first pass through refactoring all tagging. Need to test and bugfix 2022-06-21 23:25:04 -04:00
Nathan Braswell
b7bfc314e6 Did most of re-tagging, pick back up porting at compile 2022-06-21 02:18:06 -04:00
Nathan Braswell
dda581f839 Initial interning of symbols 2022-06-20 17:20:50 -04:00
Nathan Braswell
34c6d01c31 Implement deriv benchmark 2022-05-18 01:26:08 -04:00
Nathan Braswell
025ca41c59 Add support for command line arguments as a monad 2022-05-16 01:35:36 -04:00
Nathan Braswell
8c773fd0d8 Add deallocation in TCE for rare-er stuff - our test doesn't actually use it yet 2022-05-14 02:20:05 -04:00
Nathan Braswell
6683344357 Initial implementation of TCE - doesn't properly drop params/locals, and doesn't activate for the RB-Test for some reason, but does run for the long_fact 2022-05-12 00:34:19 -04:00
Nathan Braswell
50d68c3424 Groundwork for Tail Call Elimination. Prints out when it should happen, but doesn't actually do it 2022-05-11 00:59:41 -04:00
Nathan Braswell
a966c0c0ba Using a nice Pure Nix Flake now, implement Koka-style rb-tree test (only running on 100 instead of 42,000,000 - .06s compiled, 40m54s interpreted!!!), also a small fact to test loops - spoiler alert we need tail-call-elimination 2022-05-09 23:42:39 -04:00
Nathan Braswell
20d554dfe6 Fixed dropping 0-length arrays, RB-Tree seems to work well now! 2022-05-08 19:38:44 -04:00
Nathan Braswell
ca68826fbc Clean up and rearrange 2022-05-07 16:09:16 -04:00
Nathan Braswell
6140a7a006 Comment out un-val error message generation, was taking an absurd amount of space in final binary 2022-05-07 14:52:32 -04:00
Nathan Braswell
9bb6104952 Much more real match with arrays and unquote, also added unquote to parser and made log return its last argument 2022-05-06 00:35:31 -04:00
Nathan Braswell
c3b2a852b7 Fix debug not being called because of the function index renumbering, add calling debug for calling not a function in eval. For some reason this crashes redebug :/ 2022-05-03 23:25:56 -04:00
Nathan Braswell
172512f447 Fix array inequality case 2022-05-03 22:49:50 -04:00
Nathan Braswell
2a6ee6d8e4 Fix inlineing se not being set to nil (but default 0 by wasm) so it always equaled 0 2022-05-03 22:09:37 -04:00
Nathan Braswell
d420b6491f Fix regression - was using the wrong error when blocking recursion and treating as real error instead of stop recursion fallback 2022-04-25 09:19:14 -04:00
Nathan Braswell
223147f699 Initial inlining working - fib_let went from .4 something to .138. Suspect the remaining slowdown over fib is extra refcounting calls, but unsure. Compile error on fib_manual, need to see whether it was this change or the earlier find fixes 2022-04-25 09:07:42 -04:00
Nathan Braswell
8b3cab7a2f Fix multiple cond/slice bugs revealed by LotusRonin's new find testcase 2022-04-24 20:39:51 -04:00
Nathan Braswell
6c51639c6e Thread through inline_symbols and inline_level to prep for inlining impl 2022-04-23 01:41:52 -04:00
Nathan Braswell
18250e716f Ah, the remaining calls were to =. Added 'inlining' the = and comp_helper loop into repeated calls to comp_helper_helper, eliminating the param array overhead. Now fib only allocates 10 times (instead of 4 million), and runs in .107s, finally beating Python handilly and becoming about 2x as slow as Chez. Feels like a decent spot for now, and that was most all of the low hanging fruit. The only thing left now is inlining of user functions to get fib_let performing as well - it looks glacial now at .4s because of the 2 remaining closure calls that the let expands to 2022-04-21 01:09:10 -04:00
Nathan Braswell
0cb52eb0b4 Add inlining of add and subtract, and now might be beating Python, though not by a statistically significant amount with the number of tests. Fib is still allocating 4 million times or so, which is weird, since +&- should have been the last calls to do so. Time to track that down 2022-04-20 23:47:36 -04:00