Commit Graph

201 Commits

Author SHA1 Message Date
Danila Fedorin 0e3f16139d Make llvm_context a class. 2020-09-15 19:08:00 -07:00
Danila Fedorin 55486d511f Make some refactors for name mangling and encapsulation. 2020-09-15 18:51:28 -07:00
Danila Fedorin 6080094c41 Require mangled names for global variables. 2020-09-15 14:39:31 -07:00
Danila Fedorin 6b8d3b0f8a Refactor errors and update post draft. 2020-09-11 21:29:49 -07:00
Danila Fedorin 725958137a Factor type into case strategy constructor. 2020-09-11 13:03:00 -07:00
Danila Fedorin fe1e0a6de0 Switch to using FILE* and default YY_INPUT. 2020-09-11 02:16:29 -07:00
Danila Fedorin 1f3c42fc44 Change constructor visibility to global.
Constructors are always effectively global.
2020-09-10 20:11:55 -07:00
Danila Fedorin 13214cee96 Try out unboxing integers. 2020-09-10 17:32:16 -07:00
Danila Fedorin 579c7bad92 Enable more syntax. 2020-09-10 16:04:44 -07:00
Danila Fedorin f00a6a7783 Actually use the environment for binop functions. 2020-09-10 16:03:56 -07:00
Danila Fedorin 2a81fdd9fb Stop using mangled names for local variables. 2020-09-10 15:14:19 -07:00
Danila Fedorin 17c59e595c Add assertion regarding local name mangling. 2020-09-10 15:05:02 -07:00
Danila Fedorin ad2576eae2 Move common code into loops. 2020-09-10 14:50:03 -07:00
Danila Fedorin 72d8179cc5 Add compile-time flag to disable output. 2020-09-10 14:07:28 -07:00
Danila Fedorin dbabec0db6 Tweak parsed type error warning. 2020-09-10 14:04:06 -07:00
Danila Fedorin 76675fbc9b Make make_case_for throw from the second time on.
Also clean up the errors thrown a little bit.
2020-09-10 14:03:04 -07:00
Danila Fedorin ca395b5c09 Add programs to trigger error cases. 2020-09-10 14:02:19 -07:00
Danila Fedorin 1a05d5ff7a Add type errors to identifier nodes. 2020-09-10 12:59:26 -07:00
Danila Fedorin 56f0dbd02f Prevent case compilation from crashing and burning. 2020-09-10 12:53:55 -07:00
Danila Fedorin 9fc0ff961d Add more built-in boolean-specific instructions. 2020-09-10 12:44:41 -07:00
Danila Fedorin 73441dc93b Register booleans as internal types. 2020-09-10 00:54:35 -07:00
Danila Fedorin df5f5eba1c Make sure to delete LLVM target machine. 2020-09-09 23:45:48 -07:00
Danila Fedorin d950b8dc90 Initialize graph indegree. 2020-09-09 23:44:53 -07:00
Danila Fedorin 85394b185d Add prototype impl of case specialization.
Boolean cases could be translated to ifs, and
integer cases to jumps. That's still in progress.
2020-09-09 22:49:35 -07:00
Danila Fedorin 86b49f9cc3 Add 'internal' types. 2020-09-09 18:08:38 -07:00
Danila Fedorin 9769b3e396 Replace throw 0 with real exceptions or assertions. 2020-09-09 17:19:23 -07:00
Danila Fedorin e337992410 Add sources for unification type errors. 2020-09-09 15:26:18 -07:00
Danila Fedorin d5c3a44041 Add extra line after code fence. 2020-09-09 15:25:48 -07:00
Danila Fedorin eade42be49 Print locations in non-unification type errors. 2020-09-09 15:15:25 -07:00
Danila Fedorin d0fac50cfd Add locations to patterns. 2020-09-09 15:15:09 -07:00
Danila Fedorin dd4aa6fb9d Require C++17 for optionals 2020-09-09 15:14:37 -07:00
Danila Fedorin aa867b2e5f Add locations to error reporting. 2020-09-09 15:08:43 -07:00
Danila Fedorin 2fa2be4b9e Add a method to print location. 2020-09-09 14:41:16 -07:00
Danila Fedorin d5536467f6 Touch up source index code. 2020-09-09 14:20:10 -07:00
Danila Fedorin 67cb61c93f Keep track of locations in definitions. 2020-09-09 14:19:46 -07:00
Danila Fedorin 578d580683 Make driver keep track of line numbers and locations. 2020-09-09 13:57:01 -07:00
Danila Fedorin 789f277780 Update ASTs to actually take in locations.
Didn't realize I broke the build by leaving this out.
2020-09-09 13:29:28 -07:00
Danila Fedorin 308ec615b9 Start using driver, and switch to file IO. 2020-09-09 13:28:43 -07:00
Danila Fedorin 0e40c9e216 Enable locations. 2020-09-09 12:21:50 -07:00
Danila Fedorin 5dbf75b5e4 Fork off version 13 of the compiler. 2020-09-08 18:38:05 -07:00
Danila Fedorin 841930a8ef Add time traveling code. 2020-07-30 00:57:47 -07:00
Danila Fedorin d64a0d1fcd Add version of typesafe interpreter with tuples. 2020-07-23 16:38:54 -07:00
Danila Fedorin b078ef9a22 Remove implicit arguments from TypsafeIntrV2. 2020-07-22 14:30:47 -07:00
Danila Fedorin 1f734a613c Add the second part of the typechecking post. 2020-07-19 22:56:44 -07:00
Danila Fedorin a3c299b057 Start working on the improved type-safe interpreter. 2020-07-19 17:16:31 -07:00
Danila Fedorin 7c4cfbf3d4 Fix typechecking of mutually recursive functions. 2020-06-21 00:47:26 -07:00
Danila Fedorin 8524e098a8 Make proofreading-based fixes. 2020-06-20 23:50:26 -07:00
Danila Fedorin 971f58da9b Finish draft of part 12 of compiler series. 2020-06-20 22:03:57 -07:00
Danila Fedorin 600d5b91ea Remove unneeded parent class. 2020-06-18 23:06:13 -07:00
Danila Fedorin ad1946e9fb Add first draft of lambdas. 2020-06-14 02:00:20 -07:00
Danila Fedorin 68910458e8 Properly handle null types in pattern typechecking. 2020-06-14 00:43:39 -07:00
Danila Fedorin 240e87eca4 Use mangled names in variable environments. 2020-06-13 23:43:52 -07:00
Danila Fedorin 6b5f7e25b7 Maybe finish the let/in code? 2020-06-01 00:23:41 -07:00
Danila Fedorin e7229e644f Start working on translation. 2020-05-31 18:52:52 -07:00
Danila Fedorin 08c8aca144 Start working on a lifted version of a definition. 2020-05-31 14:37:33 -07:00
Danila Fedorin 7f8dae74ac Adjust type output. 2020-05-31 00:50:58 -07:00
Danila Fedorin 08503116ff Mark some definitions as global, so as not to capture them. 2020-05-31 00:34:12 -07:00
Danila Fedorin a1d679a59d No longer destroy the list of free variables.
It so happens that this list will tell us which variables
need to be captured.
2020-05-30 23:29:36 -07:00
Danila Fedorin 4586bd0188 Check for free variables in the environment before generalizing. 2020-05-30 16:40:27 -07:00
Danila Fedorin a97b50f497 Add parsing of let/in. 2020-05-28 14:44:12 -07:00
Danila Fedorin c84ff11d0d Add typechecking to let/in expressions. 2020-05-26 00:52:54 -07:00
Danila Fedorin e966e74487 Extract ordering functionality into definition group. 2020-05-25 23:58:56 -07:00
Danila Fedorin 3865abfb4d Add a struct to contain groups of mutually recursive definitions. 2020-05-25 22:11:45 -07:00
Danila Fedorin 1905601aaa Fork off the 12th version of the compiler. 2020-05-25 21:20:41 -07:00
Danila Fedorin 18339d7e4d Build and test version 11 of the compiler instead of 10.
continuous-integration/drone/push Build is failing Details
2020-04-26 21:28:34 -07:00
Danila Fedorin 78563448fb Update to LLVM 10.
continuous-integration/drone/push Build is failing Details
2020-04-26 21:24:24 -07:00
Danila Fedorin c1f0104edb Add missing arity checks to compiler series
continuous-integration/drone/push Build is failing Details
2020-04-14 19:21:33 -07:00
Danila Fedorin 1f00b6a3f8 Make compiler check for arity in part 11 of compiler series.
continuous-integration/drone/push Build is failing Details
2020-04-14 16:20:12 -07:00
Danila Fedorin acb22c4119 Finish draft of part 11 of compiler series 2020-04-14 16:19:54 -07:00
Danila Fedorin be2b855ffe Rename inaccurately named rule 2020-04-14 15:58:25 -07:00
Danila Fedorin 88c9418350 Update example to include polymorphism 2020-04-14 15:58:13 -07:00
Danila Fedorin b4c91d2dd4 Adjust grammar to allow for broader range of type inputs. 2020-04-13 23:17:34 -07:00
Danila Fedorin 98c1b5a3b2 Make substitution replace types at every lookup step 2020-04-13 17:59:57 -07:00
Danila Fedorin 122a1d73d3 Integrate new types into the rest of the project 2020-04-13 17:12:43 -07:00
Danila Fedorin 74e6dba914 Add parsed type data structure, type application and arity. 2020-04-13 17:08:03 -07:00
Danila Fedorin d7846e0b32 Fork off code for part 11 of compiler series.
continuous-integration/drone/push Build is failing Details
2020-04-09 23:48:53 -07:00
Danila Fedorin 8c1168d818 Add seemingly missing string includes. 2020-04-09 16:26:10 -07:00
Danila Fedorin 5cccb97ede Add missing source file
continuous-integration/drone/push Build is passing Details
2020-03-25 03:36:17 -07:00
Danila Fedorin 493419f324 Remove debug output
continuous-integration/drone/push Build is failing Details
2020-03-25 03:35:30 -07:00
Danila Fedorin 577e0ad930 Finalize draft of polymorphism post
continuous-integration/drone/push Build is failing Details
2020-03-25 03:22:21 -07:00
Danila Fedorin 2a12f7f31e Switch to using type schemes and implement polymorphism in compiler series 2020-03-24 23:04:51 -07:00
Danila Fedorin ae3e661d7a Implement new ordered typing in compiler series 2020-03-24 22:00:11 -07:00
Danila Fedorin 0efa05142f Separate definitions in compiler series 2020-03-24 21:08:06 -07:00
Danila Fedorin 6714e18e7c Switch type environment to using pointers 2020-03-24 18:04:01 -07:00
Danila Fedorin 5d53678e83 Only store type in case expression
continuous-integration/drone/push Build is passing Details
2020-03-24 17:53:06 -07:00
Danila Fedorin e3834ed6ea Explain graph code
continuous-integration/drone/push Build is passing Details
2020-03-14 21:04:13 -07:00
Danila Fedorin 1bdb4a650e Start work on algorithms in compiler post 10
continuous-integration/drone/push Build is passing Details
2020-03-14 17:18:06 -07:00
Danila Fedorin 6966973497 Set up script to test latest compiler version
continuous-integration/drone/push Build is passing Details
2020-03-10 22:26:02 -07:00
Danila Fedorin 8ee016e189 Fork into version 10 of the compiler for blog series 2020-03-10 20:58:26 -07:00
Danila Fedorin 33b1457e91 Add first draft of Idris post 2020-02-29 16:12:12 -08:00
Danila Fedorin 9e399ebe3c Add initial draft of typesafe interpreter post
continuous-integration/drone/push Build is passing Details
2020-02-27 23:09:51 -08:00
Danila Fedorin c207d1dfcf Remove unused line at the end of works1.txt 2020-02-23 21:26:37 -08:00
Danila Fedorin 0f744888ef Move testing code into a script 2020-02-11 18:37:21 -08:00
Danila Fedorin e7f0ccfa16 Finish compiler series 2020-02-10 19:18:55 -08:00
Danila Fedorin e5d01a4e19 Add the primes program from compiler series 2020-02-10 18:13:04 -08:00
Danila Fedorin b7d72f2fbf Implement garbage collection in runtime 2020-02-06 11:32:19 -08:00
Danila Fedorin 281dbbd174 Track allocated nodes using a G-machine struct in compiler series. 2020-02-06 10:05:26 -08:00
Danila Fedorin 8d22acfe78 Switch to single stack in runtime for Compiler Series 2020-01-31 15:29:12 -08:00
Danila Fedorin 803f52b2d0 Update the compiler to leave the stack clean 2020-01-27 20:29:01 -08:00
Danila Fedorin 2f96abeef6 Instantiate compiler for garbage collection 2020-01-27 14:52:25 -08:00