Commit graph

95 commits

Author SHA1 Message Date
Samuel Hammersberg
2af00da482 Renamed the compile function to generate code 2023-03-08 10:25:53 +01:00
Samuel Hammersberg
832efbcdd8 Gave the code generator a proper module name. 2023-03-08 10:24:52 +01:00
Samuel Hammersberg
bff75bb00b Switched an Int to Integer. 2023-03-08 10:22:21 +01:00
Samuel Hammersberg
7cf6f30835 Data type constructors now properly tag the data. 2023-02-24 18:37:31 +01:00
Samuel Hammersberg
262543931c Types for data types are now created. 2023-02-24 16:05:49 +01:00
Samuel Hammersberg
272fbe3504 Removed some unused code. 2023-02-24 09:29:55 +01:00
Samuel Hammersberg
5d004f4286 Added calling conventions to functions. 2023-02-24 09:00:29 +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
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
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
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
Samuel Hammersberg
7cedc2e28c Started adding cases to the grammar. 2023-02-17 15:25:06 +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
Rakarake
514c809b1e Pinned nix channel, made makefile not error 2023-02-14 15:47:36 +01:00
Samuel Hammersberg
7c1e1d57a0 Merge remote-tracking branch 'origin/main' into llvm_testing 2023-02-12 13:17:45 +01:00
Samuel Hammersberg
9f4c3a3cbf
Merge pull request #6 from bachelor-group-66-systemf/codegen-martin-4
Add lambda lifter
2023-02-12 12:06:49 +00:00
Martin Fredin
3fe990ceaa Don't run interpreter by default 2023-02-12 13:01:12 +01:00
Samuel Hammersberg
818e57ff14 Updated main to use the updated Code Generator. 2023-02-11 14:14:21 +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
e212c79a44 Revert back to one lambda par, and fix issues with lambda lifter 2023-02-11 09:59:26 +01:00
Martin Fredin
78a3ed56ea Add test 2023-02-10 16:55:56 +01:00
Martin Fredin
f3600ffdf8 Fix documentation and small things 2023-02-10 16:45:33 +01:00
Martin Fredin
5956cdf121 Fix typo 2023-02-10 16:45:33 +01:00
Martin Fredin
8688b303ac Fix unnecessary supercombinator issue 2023-02-10 16:45:33 +01:00
Martin Fredin
ece621b0aa Fix auxiliary path 2023-02-10 16:45:33 +01:00
Martin Fredin
8663f2ea50 Some clean up and documenting 2023-02-10 16:45:33 +01:00
Martin Fredin
8c094236aa Add auxiliary module 2023-02-10 16:45:33 +01:00
Martin Fredin
3d8bd24c7b Fix basic tests 2023-02-10 16:45:33 +01:00
Martin Fredin
bd792f7785 Add llvm dep 2023-02-10 16:45:33 +01:00
Martin Fredin
08917be1c6 Fix first unnecessary supercombinator 2023-02-10 16:45:33 +01:00
Martin Fredin
69254f8032 Finish Lambda Lifter 2023-02-10 16:45:33 +01:00