├── LICENSE ├── README.md ├── Setup.hs ├── lc-hs.cabal ├── resources ├── precompiled-modules │ ├── constants.ll │ ├── driver.ll │ └── primitives.ll └── tests │ ├── test-cond.ans │ ├── test-cond.scm │ ├── test-defvar.ans │ ├── test-defvar.scm │ ├── test-freevar.ans │ ├── test-freevar.scm │ ├── test-globalfunc.ans │ ├── test-globalfunc.scm │ ├── test-innerlambdas.ans │ ├── test-innerlambdas.scm │ ├── test-list.ans │ ├── test-list.scm │ ├── test-listconst.ans │ ├── test-listconst.scm │ ├── test-pair.ans │ ├── test-pair.scm │ ├── test-seqtoplevel.ans │ ├── test-seqtoplevel.scm │ ├── test-sequence.ans │ ├── test-sequence.scm │ ├── test-set1.ans │ ├── test-set1.scm │ ├── test-set2.ans │ ├── test-set2.scm │ ├── test-string.ans │ ├── test-string.scm │ ├── test-vecconst.ans │ ├── test-vecconst.scm │ ├── test-vector.ans │ └── test-vector.scm ├── src-c ├── constants.c ├── constants.h ├── driver.c ├── primitives.c └── primitives.h ├── src-executable └── Main.hs ├── src-test └── Tests.hs └── src ├── Codegen.hs ├── CrispMain.hs ├── Emit.hs ├── Immediates.hs ├── JIT.hs ├── Lexer.hs ├── Options.hs ├── Parser.hs ├── Syntax.hs └── Utils.hs /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/README.md -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /lc-hs.cabal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/lc-hs.cabal -------------------------------------------------------------------------------- /resources/precompiled-modules/constants.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/precompiled-modules/constants.ll -------------------------------------------------------------------------------- /resources/precompiled-modules/driver.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/precompiled-modules/driver.ll -------------------------------------------------------------------------------- /resources/precompiled-modules/primitives.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/precompiled-modules/primitives.ll -------------------------------------------------------------------------------- /resources/tests/test-cond.ans: -------------------------------------------------------------------------------- 1 | (2 3 5 6 9 10) 2 | -------------------------------------------------------------------------------- /resources/tests/test-cond.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-cond.scm -------------------------------------------------------------------------------- /resources/tests/test-defvar.ans: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /resources/tests/test-defvar.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-defvar.scm -------------------------------------------------------------------------------- /resources/tests/test-freevar.ans: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /resources/tests/test-freevar.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-freevar.scm -------------------------------------------------------------------------------- /resources/tests/test-globalfunc.ans: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /resources/tests/test-globalfunc.scm: -------------------------------------------------------------------------------- 1 | (define f (lambda(x) (+ x 1))) (f 3) 2 | -------------------------------------------------------------------------------- /resources/tests/test-innerlambdas.ans: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /resources/tests/test-innerlambdas.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-innerlambdas.scm -------------------------------------------------------------------------------- /resources/tests/test-list.ans: -------------------------------------------------------------------------------- 1 | (1 2 (#\a #\b #\c) . 3) 2 | -------------------------------------------------------------------------------- /resources/tests/test-list.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-list.scm -------------------------------------------------------------------------------- /resources/tests/test-listconst.ans: -------------------------------------------------------------------------------- 1 | (#\a 1 2 3 4) 2 | -------------------------------------------------------------------------------- /resources/tests/test-listconst.scm: -------------------------------------------------------------------------------- 1 | (define l '(1 2 3 4)) 2 | (cons #\a l) 3 | -------------------------------------------------------------------------------- /resources/tests/test-pair.ans: -------------------------------------------------------------------------------- 1 | (4 . 5) 2 | -------------------------------------------------------------------------------- /resources/tests/test-pair.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-pair.scm -------------------------------------------------------------------------------- /resources/tests/test-seqtoplevel.ans: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /resources/tests/test-seqtoplevel.scm: -------------------------------------------------------------------------------- 1 | (define f (lambda(x) x 2)) 3 (f 1) 2 | -------------------------------------------------------------------------------- /resources/tests/test-sequence.ans: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /resources/tests/test-sequence.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-sequence.scm -------------------------------------------------------------------------------- /resources/tests/test-set1.ans: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /resources/tests/test-set1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-set1.scm -------------------------------------------------------------------------------- /resources/tests/test-set2.ans: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /resources/tests/test-set2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-set2.scm -------------------------------------------------------------------------------- /resources/tests/test-string.ans: -------------------------------------------------------------------------------- 1 | "it works 2 | yes it does" 3 | -------------------------------------------------------------------------------- /resources/tests/test-string.scm: -------------------------------------------------------------------------------- 1 | "it works\nyes it does" 2 | -------------------------------------------------------------------------------- /resources/tests/test-vecconst.ans: -------------------------------------------------------------------------------- 1 | #(1 2 #f 4) 2 | -------------------------------------------------------------------------------- /resources/tests/test-vecconst.scm: -------------------------------------------------------------------------------- 1 | (define v #(1 2 3 4)) 2 | (vector-set! v 2 #f) 3 | v 4 | -------------------------------------------------------------------------------- /resources/tests/test-vector.ans: -------------------------------------------------------------------------------- 1 | #t 2 | -------------------------------------------------------------------------------- /resources/tests/test-vector.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/resources/tests/test-vector.scm -------------------------------------------------------------------------------- /src-c/constants.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-c/constants.c -------------------------------------------------------------------------------- /src-c/constants.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-c/constants.h -------------------------------------------------------------------------------- /src-c/driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-c/driver.c -------------------------------------------------------------------------------- /src-c/primitives.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-c/primitives.c -------------------------------------------------------------------------------- /src-c/primitives.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-c/primitives.h -------------------------------------------------------------------------------- /src-executable/Main.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-executable/Main.hs -------------------------------------------------------------------------------- /src-test/Tests.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src-test/Tests.hs -------------------------------------------------------------------------------- /src/Codegen.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Codegen.hs -------------------------------------------------------------------------------- /src/CrispMain.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/CrispMain.hs -------------------------------------------------------------------------------- /src/Emit.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Emit.hs -------------------------------------------------------------------------------- /src/Immediates.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Immediates.hs -------------------------------------------------------------------------------- /src/JIT.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/JIT.hs -------------------------------------------------------------------------------- /src/Lexer.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Lexer.hs -------------------------------------------------------------------------------- /src/Options.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Options.hs -------------------------------------------------------------------------------- /src/Parser.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Parser.hs -------------------------------------------------------------------------------- /src/Syntax.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Syntax.hs -------------------------------------------------------------------------------- /src/Utils.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/talw/crisp-compiler/HEAD/src/Utils.hs --------------------------------------------------------------------------------