Commit Graph

88 Commits

Author SHA1 Message Date
Emi Simpson 37c809f5c0
Restructure how builtins work to improve inspectability 2024-03-17 09:03:23 -04:00
Emi Simpson b0ccfc6309
Optimization: Special case for simplying recursive let bindings codegen 2024-03-16 22:23:06 -04:00
Emi Simpson 6f89dfa1c5
Optimization: Remove redundant let expressions 2024-03-16 22:21:02 -04:00
Emi Simpson 719de87ea9
Perform match elimination at IR generation rather than codegen 2024-03-16 19:42:09 -04:00
Emi Simpson e6d8933ccf
BUG: Substitution does not penetrate Switch expressions 2024-03-16 18:08:40 -04:00
Emi Simpson 55fa7add0e
Add special case to improve quality of generated code for simple functions 2024-03-16 09:36:30 -04:00
Emi Simpson 79deebabf4
Fix bug: Recursion shares a single variable between all stack frames when compiling to JS 2024-03-16 09:18:41 -04:00
Emi Simpson 2238d363e5
Generate slightly smaller code for switch and let 2024-03-15 20:21:48 -04:00
Emi Simpson cd87c0fc08
Don't include `fibb_helper` in the produced bindings for the fibbonacci example 2024-03-15 20:21:48 -04:00
Emi Simpson 1f959551fc
Add compilation instructions to README 2024-03-15 20:21:48 -04:00
Emi Simpson 237c83f511
Fix bug: Switch statements crash when switching to the fallback branch 2024-03-15 20:21:48 -04:00
Emi Simpson f04553ac4d
Clean up some type errors
And in doing so, fix some real errors and remove some unused code
2024-03-15 20:21:47 -04:00
Emi Simpson 7b59e21183
Improve compilation output for builtins in special contexts 2024-03-15 20:21:47 -04:00
Emi Simpson fbcbe0215a
Hide builtins from compilation output 2024-03-15 20:21:47 -04:00
Emi Simpson 9dda964aca
Make fibb.json generate bindings rather than a function 2024-03-15 20:21:47 -04:00
Emi Simpson d0ebd8cfa5
Make compiled bindings const 2024-03-15 20:21:46 -04:00
Emi Simpson 666488ce0f
Fixed match tree merges creating ambiguous trees
Now match tree merging favors the most specific match possible
2024-03-15 20:21:46 -04:00
Emi Simpson 88399fff69
Implement compilation 2024-03-15 20:21:46 -04:00
Emi Simpson 673292e913
Add a README 2024-03-15 20:21:46 -04:00
Emi Simpson aa93a85d7c
Add missing import 2024-03-15 20:21:45 -04:00
Emi Simpson 79c503678e
Added merge_with 2024-03-15 20:21:45 -04:00
Emi Simpson 8f69581893
Pair down generated js a bit 2024-03-15 20:21:45 -04:00
Emi Simpson cdf33bd6da
Add compilation to JavaScript 2024-03-15 20:21:45 -04:00
Emi Simpson f5d999a3dd
Don't use recursion in evaluate :( 2024-03-15 20:21:44 -04:00
Emi Simpson d94ff158f7
Make function type rendering prettier 2024-03-15 20:21:44 -04:00
Emi Simpson 97cd81dc43
Add some more stuff to the example file 2024-03-15 20:21:44 -04:00
Emi Simpson 5c869516e2
Upgrade the REPL UI 2024-03-15 20:21:44 -04:00
Emi Simpson d5649b0523
Return actually analagus types in BranchMismatch 2024-03-15 20:21:43 -04:00
Emi Simpson ca685d7ded
Fix substitution not working for polytypes
honestly i don't know how i didn't catch that sooner
2024-03-15 20:21:43 -04:00
Emi Simpson fb55346003
Make typechecking slightly less buggy
- The statement ["x", "x"] no longer typechecks in the empty context
- The statement ["ident": {"x": "x"}] now correctly generalizes
- The statement ["compose", "compose", "compose"] no longer goes into an infinite loop
2024-03-15 20:21:43 -04:00
Emi Simpson 792674797d
Buggy typechecking 2024-03-15 20:21:43 -04:00
Emi Simpson 907bc5d505
Add an example json 2024-03-15 20:21:43 -04:00
Emi Simpson 224ec0bc98
Add a repl 2024-03-15 20:21:42 -04:00
Emi Simpson 0383bc5b82
Take out the old recursion thingy 2024-03-15 20:21:42 -04:00
Emi Simpson a49b7b5baf
Add let statements 2024-03-15 20:21:42 -04:00
Emi Simpson c27852daba
Add in IR generation 2024-03-15 20:21:42 -04:00
Emi Simpson 92d458de85
Add partition 2024-03-15 20:21:41 -04:00
Emi Simpson 206c0a0ec0
Start making a grammar then realize there's a builtin json parser 2024-03-15 20:21:41 -04:00
Emi Simpson bc2a2e2a8c
Functional operation semantics 2024-03-15 20:21:41 -04:00
Emi Simpson c4098d8c2b
Add parse_, expand some doc tests 2024-03-15 20:21:41 -04:00
Emi Simpson 08547aea2f
Add a combinator parser 2024-03-15 20:21:40 -04:00
Emi Simpson dfdbda4406
Fixed a bug which caused unnecessary infinite recursion 2024-03-15 20:21:40 -04:00
Emi Simpson 73e9771e6c
Rename main -> lab2 2024-03-15 20:21:40 -04:00
Emi Simpson d39a78fae7
Add a main! Now it works! 2024-03-15 20:21:40 -04:00
Emi Simpson 6f0d15ee3f
Finagle some types and imports 2024-03-15 20:21:39 -04:00
Emi Simpson 9d6da82dd4
Fix broken tests in build_oracle 2024-03-15 20:21:39 -04:00
Emi Simpson 0605b759f0
Fix failing doctests in lex.py 2024-03-15 20:21:39 -04:00
Emi Simpson 57130c9233
Clean up some unused functions 2024-03-15 20:21:39 -04:00
Emi Simpson 6353522827
Get resolution working for real! 2024-03-15 20:21:38 -04:00
Emi Simpson 475c324e64
Add next_generation 2024-03-15 20:21:38 -04:00