Commit graph

705 commits

Author SHA1 Message Date
valtermiari
6fff6ef2d1 Some tweaks in mark. Testing of chain references 2023-02-21 17:38:45 +01:00
sebastianselander
8065576c31 Let has a bug, otherwise probably(?) done 2023-02-20 20:38:36 +01:00
Victor Olin
12a460ae4c Fixed heap DLL linking 2023-02-20 18:15:58 +01:00
sebastianselander
a98135827c EAdd is bugged. Mostly complete though. 2023-02-20 16:51:44 +01:00
Samuel Hammersberg
4df3f705ed LLVMIr code now has the fastcc flag to enable speeed 😎 2023-02-20 16:44:27 +01:00
Samuel Hammersberg
afbc700db2 Fixed the type checker accidentally chucking cases in some cases. 2023-02-20 16:43:54 +01:00
Samuel Hammersberg
cd0f9dd456 The output directory is now cleared when the program is ran. 2023-02-20 15:27:13 +01:00
Samuel Hammersberg
a36de2bde1 Added support for the minus operator. 2023-02-20 14:52:11 +01:00
Samuel Hammersberg
fe4533c7ae Added an option to output some debug info. 2023-02-20 14:39:56 +01:00
Samuel Hammersberg
6749650223 Added support for pattern matching on ints. Might need a lookover. 2023-02-20 14:39:43 +01:00
Samuel Hammersberg
18e0a92fe0 Added grammar for case matching. 2023-02-20 14:39:00 +01:00
valtermiari
ce3a6d36f0 Tweaked sweeping, test with detached pointers 2023-02-20 14:34:57 +01:00
sebastianselander
dfbdb6678e Working on non-ugly version of algorithm W (Hindley-Milner) 2023-02-20 12:09:31 +01:00
Victor Olin
a9998a7816 Fixed mark skipping
Co-authored-by: ValterMiari <ValterMiari@users.noreply.github.com>
2023-02-20 11:45:07 +01:00
Victor Olin
ff8c270cb8 Wrote a test for shared library linking 2023-02-19 21:02:08 +01:00
sebastianselander
420fb107f0 Commented code and fixed some bugs I think. Still not complete
id : Int -> Int
id x = x
does not type check
2023-02-19 15:25:49 +01:00
sebastianselander
db932048ba Tried fixing bug. Failed. 2023-02-19 02:10:57 +01:00
sebastianselander
8b5cd3cf9a Remade the algorithm myself. Still some bugs. 2023-02-18 23:08:27 +01:00
Victor Olin
c20ef8f5dd clean up 2023-02-18 15:05:02 +01:00
Samuel Hammersberg
087850d1cf
Merge pull request #8 from bachelor-group-66-systemf/prep-tc-merge
Add simple type checker and convert pipleline to use typed AST
2023-02-18 14:03:40 +00:00
Samuel Hammersberg
a4c12ede79 Merge branch 'prep-tc-martin' of github.com:bachelor-group-66-systemf/language into prep-tc-martin 2023-02-18 15:03:11 +01:00
Martin Fredin
f485ca9762 Remove case expressions 2023-02-18 14:49:33 +01:00
Martin Fredin
4ab6681f68 Rearrange code 2023-02-18 14:36:59 +01:00
Samuel Hammersberg
287f84377c Implemented case matching on ints in the code generator 2023-02-18 14:36:46 +01:00
Martin Fredin
3efb27ac0c Document and fix code style 2023-02-18 13:41:38 +01:00
Martin Fredin
b8aedd541d Document and fix code style 2023-02-18 13:35:33 +01:00
Victor Olin
c6c0468c8d Implemented free chunk swaps and filtering 2023-02-18 13:31:16 +01:00
Martin Fredin
21fb6bf5ed Fix indentation 2023-02-18 13:27:58 +01:00
Martin Fredin
ad615cc9d8 Document and fix code style 2023-02-18 13:26:41 +01:00
Martin Fredin
a3e57dde7b Change grammar: only one bind in let and no EAnn for typed syntax 2023-02-18 13:02:25 +01:00
sebastianselander
f188cffb8d Unification part works (probably). Have a hard time understanding it. 2023-02-17 18:42:50 +01:00
Samuel Hammersberg
7cedc2e28c Started adding cases to the grammar. 2023-02-17 15:25:06 +01:00
Victor Olin
5f6a18a2ab Debugged mark()
Co-authored-by: ValterMiari <ValterMiari@users.noreply.github.com>
2023-02-17 12:14:11 +01:00
sebastianselander
764faa582b Remove hls pragmas 2023-02-17 12:01:57 +01:00
sebastianselander
f2e8a02255 Removed adhoc tests 2023-02-17 12:01:22 +01:00
sebastianselander
a9f54dbca1 Simplified quite a bit. Made a unify function. Still bugs left 2023-02-17 11:09:48 +01:00
valtermiari
d40350a263 Some progress on marking 2023-02-17 10:29:48 +01:00
valtermiari
f637a396b7 Fixed sweep 2023-02-16 22:40:43 +01:00
valtermiari
72a044cd59 More debugging 2023-02-16 18:37:02 +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
Victor Olin
5157e6b41d Continued debugging
Co-authored-by: ValterMiari <ValterMiari@users.noreply.github.com>
2023-02-16 16:23:35 +01:00
Victor Olin
fb1e177130 Testing different stack pointers 2023-02-16 15:22:26 +01:00
Martin Fredin
d345ccb33b Fix import statement 2023-02-16 14:22:40 +01:00
Samuel Hammersberg
ab34666484 Fixed types on functions in the code generator. 2023-02-16 14:16:08 +01:00
Samuel Hammersberg
6d9c42a03e Got higher order functions working. 2023-02-16 13:36:45 +01:00
Samuel Hammersberg
46c6f5b7ab Fixed scoping of function pointers. 2023-02-16 11:17:45 +01:00
Samuel Hammersberg
5680334fde Fixed some small issues. 2023-02-16 10:03:25 +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