Commit graph

21 commits

Author SHA1 Message Date
Samuel Hammersberg
fe4533c7ae Added an option to output some debug info. 2023-02-20 14:39:56 +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
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
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
Samuel Hammersberg
fd64a7e669 Added a function to load the Standard LLVM library at runtime. 2023-01-24 11:38:33 +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