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
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
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
sebastianselander
73dc2e4b6a
Inference on most expressions. HM based.
...
Still have to figure out how to infer type of lambda variables, as well
as how function application on polymorphic should work
2023-02-13 12:17:49 +01:00
Samuel Hammersberg
7c1e1d57a0
Merge remote-tracking branch 'origin/main' into llvm_testing
2023-02-12 13:17:45 +01:00
Samuel Hammersberg
5d5a610cca
Made compiler state more generic, and compile no longer outputs IO and instead returns the result.
2023-02-11 14:12:27 +01:00
Martin Fredin
d67eddcf0f
Fix interpreter
2023-02-11 11:04:39 +01:00
Martin Fredin
8c094236aa
Add auxiliary module
2023-02-10 16:45:33 +01:00
Martin Fredin
2a48b7477e
Implement lambda lifting passes: freeVars, abstract, and rename
2023-02-10 16:45:33 +01:00
Samuel Hammersberg
e7ef268c12
Splat LLVM Ir into its own file.
2023-02-10 16:08:45 +01:00
sebastianselander
a1e9624d5e
TTGing the lambda lifter
2023-02-10 12:09:08 +01:00
sebastianselander
f4f1786be3
Revert "Merge branch 'typechecking' into codegen-martin-3"
...
This reverts commit e000e5159f , reversing
changes made to 3ac8377fa0 .
2023-02-10 10:46:09 +01:00
sebastianselander
e000e5159f
Merge branch 'typechecking' into codegen-martin-3
2023-02-10 10:33:15 +01:00
Martin Fredin
07bec3e7ef
Add auxiliary module
2023-02-09 20:24:06 +01:00
Martin Fredin
1f47288fcf
Implement lambda lifting passes: freeVars, abstract, and rename
2023-02-09 05:19:51 +01:00
sebastianselander
84eb430c41
relaxed base dependency and added overwrite
2023-02-08 21:40:27 +01:00
Patrik Jansson
6607173b93
Typo fix (to check access).
2023-02-08 21:40:27 +01:00
Samuel Hammersberg
f8d320bb6d
Heavily shorted down the emitAdd function, and added a emitInt function.
2023-02-04 12:43:47 +01:00
Samuel Hammersberg
819f4c9406
Made a simple code generator that outputs to LLVM IR
2023-02-03 16:59:36 +01:00
sebastianselander
2a3757f391
relaxed base dependency and added overwrite
2023-02-03 11:29:42 +01:00
Patrik Jansson
8fd7966fd9
Typo fix (to check access).
2023-02-03 11:12:44 +01:00
sebastianselander
be3fcfc9e3
Typeinference/checking on expressions done.
...
Simplified the typechecker a bit, removed GADT solution for now.
Still not fully working
2023-01-24 16:39:22 +01:00
Samuel Hammersberg
fd64a7e669
Added a function to load the Standard LLVM library at runtime.
2023-01-24 11:38:33 +01:00
sebastianselander
b6b2dfa25f
Some work on a typechecker
2023-01-23 17:17:06 +01:00
Samuel Hammersberg
213e47097e
Split the compiler into it's own module and added a file for the LLVM standard library.
2023-01-23 16:57:32 +01:00
Samuel Hammersberg
b389e397b6
Started working on a simple compiler.
2023-01-22 19:43:08 +01:00
Martin Fredin
92bb18a568
Update cabal file
2023-01-20 14:00:12 +01:00
Martin Fredin
7caadcbeb9
Use src instead of app
2023-01-17 15:34:32 +01:00
Martin Fredin
157ee636e8
Change base to version which is compatible with ghc.9.2.4
2023-01-17 15:33:52 +01:00
sebastianselander
47df84f911
cabal init and added formatting options
2023-01-17 11:42:40 +01:00