Commit graph

77 commits

Author SHA1 Message Date
sebastianselander
2f8550d0e5 Cleaned files, output file name match name of text file 2023-05-30 14:39:38 +02:00
sebastianselander
e2afa2b775 justfile with qs and lc 2023-05-23 14:11:51 +02:00
sebastianselander
0fd8a9bc74 Yur 2023-05-16 17:24:51 +02:00
sebastianselander
8b92dd9194 Added η-expander module and removed EAdd from grammar. 2023-05-12 16:25:48 +02:00
sebastianselander
6260dc2c41 A lot of small changes, added better error messages for bugs mainly 2023-05-11 18:37:03 +02:00
Martin Fredin
72e599d5de Add closures and fix lets in monomorphizer 2023-05-06 22:49:08 +02:00
Martin Fredin
619242ccaf Fix lambda lifter 2023-04-29 15:52:37 +02:00
Martin Fredin
df1a5de04a Add module to sort definitions 2023-04-28 19:45:15 +02:00
Martin Fredin
9870802371 Add implicit foralls for bidir, update and unify pipeline 2023-04-05 17:26:52 +02:00
Martin Fredin
cc5755c3a9 Add layout grammar 2023-04-03 09:24:13 +02:00
Rakarake
d097cd28e8 New morb tree for internal use in monomorphizer, data types implemented 2023-03-31 17:02:54 +02:00
Samuel Hammersberg
61f364cd75 Splat up the codegenerator a bit. 2023-03-29 17:35:19 +02:00
sebastianselander
8910d8adc0 temporary commit incase of breakage 2023-03-28 17:15:18 +02:00
Rakarake
b35c19572f Newer changes 2023-03-28 15:26:35 +02:00
Samuel Hammersberg
d7549d421c Fixed a missing dependency. 2023-03-28 13:49:34 +02:00
Rakarake
4a6c72fce0 Removed codegen to compile, type seem to work for newly added example 2023-03-27 20:11:49 +02:00
Rakarake
0d23a59f0c Merged into commit not compiling on codegen 😤 2023-03-27 19:14:35 +02:00
Samuel Hammersberg
623c6d1e58 Fixed language.cabal. 2023-03-27 16:11:33 +02:00
Martin Fredin
ac3f222753 Add bidirectional type checker, lambda lifter. 2023-03-27 16:07:11 +02:00
sebastian
2974c10c0c moved tests 2023-03-26 00:13:10 +01:00
Samuel Hammersberg
e500c70529 Programs are now actually compiled all the way through. 2023-03-24 18:46:47 +01:00
Samuel Hammersberg
23c174607b temp merge 2023-03-24 18:23:59 +01:00
sebastian
fc60112877 Made binds keep args instead of lambda converting 2023-03-23 22:09:21 +01:00
sebastianselander
e3df4192bb created dummy monomorphizer 2023-03-23 17:20:19 +01:00
sebastianselander
42c8ebc7b6 Making progress towards finished product 2023-03-23 16:49:49 +01:00
Samuel Hammersberg
d3d173eb59 Merge remote-tracking branch 'origin/typechecking-merge' into pattern-matching-with-typechecking 2023-03-23 16:33:05 +01:00
sebastianselander
8d1330ad42 typechecker is compatible with one extra addition to the spec 2023-03-23 11:13:48 +01:00
Samuel Hammersberg
bbf7a47e74 Started updating the Code Generator to the new monomorphizer tree. 2023-03-21 09:39:05 +01:00
Rakarake
d377ded7e1 Deleted bad sample programs, added polymorphic call in polymorphic function test 2023-03-08 17:38:50 +01:00
Samuel Hammersberg
d5dd7896d8 Moved modules into a proper folder structure. 2023-03-08 10:35:07 +01:00
Samuel Hammersberg
832efbcdd8 Gave the code generator a proper module name. 2023-03-08 10:24:52 +01:00
Rakarake
63f9689f38 Simple polymorphic and monomorphic functions properly morphed in test demo. 2023-03-07 18:49:21 +01:00
Rakarake
887c3b8391 Working on bugs 2023-03-07 16:42:56 +01:00
Rakarake
514d79bd6c Strucute in place, MonomorpherIr module created 2023-03-01 13:50:01 +01:00
sebastianselander
05313652f9 unit tests, started on pattern matching 2023-02-28 17:15:48 +01:00
sebastianselander
bbf6e159c7 Type inference/checking on ADTs mostly complete(?). Still have to test 2023-02-27 17:22:42 +01:00
sebastianselander
2f45f39435 Incorporated most of main, as well as started on quickcheck 2023-02-27 11:12:05 +01:00
sebastianselander
06e65de235 started on a test suite 2023-02-23 11:54:35 +01:00
Samuel Hammersberg
fe4533c7ae Added an option to output some debug info. 2023-02-20 14:39:56 +01:00
sebastianselander
dfbdb6678e Working on non-ugly version of algorithm W (Hindley-Milner) 2023-02-20 12:09:31 +01:00
sebastianselander
8b5cd3cf9a Remade the algorithm myself. Still some bugs. 2023-02-18 23:08:27 +01:00
sebastianselander
f188cffb8d Unification part works (probably). Have a hard time understanding it. 2023-02-17 18:42:50 +01:00
sebastianselander
a9f54dbca1 Simplified quite a bit. Made a unify function. Still bugs left 2023-02-17 11:09:48 +01:00
sebastianselander
eafe0fea0b Rewrote using unification-fd. Heavily inspired (aka copied) from:
https://byorgey.wordpress.com/2021/09/08/implementing-hindley-milner-with-the-unification-fd-library/
2023-02-16 16:37:36 +01:00
Martin Fredin
7ef7090aa5 Merge llvm_testing, and use TypeCheckerIr instead of Abs 2023-02-16 02:17:07 +01:00
Samuel Hammersberg
8d698cecf9 Fixed some merge errors that occured when merging with main
Started implementing EApp.

Simple function calls now work.

Removed the LLVM standard library as it was not needed.

Limited functionality.

Got EApp working!!

Fixed arguments being inserted in the wrong order.

Updated the showing of `Call` so that it inserts a space inbetween arguments.

Removed some unused code from the generated main functions.

Force removed language.

Expressions that are simply just calling a constant now work properly.

Fixed constants being called inside nested expressions.

Cleaned up the compiler a bit.

Added a test suite, testing that the output from programs is correct, "evaluating the whole process".

Fixed a typo in basic-4.sf

Fixed basic-8 to work without a renamer.

Fixed some nicer output in the main function.

Made the outputted LLVM Ir somewhat nicer.

Fixed a typo and updated how SetVariable works.

Formatted and added documentation.

Added instructions allowing for branching.
2023-02-16 00:16:44 +01:00
Martin Fredin
210e55bb15 Adjust old type checker to new syntax, and refactor lambda lifter to use typed AST 2023-02-15 23:55:16 +01:00
sebastianselander
7619e36c60 Inference works better now. Still work to do. Should use proper library 2023-02-15 17:40:18 +01:00
sebastianselander
6218efac20 Renamer done.
It renames bound variables to numbers, converts let to lambda, and
removes all variables from binds
2023-02-14 16:44:38 +01:00
sebastianselander
200a9e57ed Fixed EId, more work on other expressions needed 2023-02-14 10:12:38 +01:00