Initial commit

This commit is contained in:
Griffin Smith 2021-03-07 15:29:59 -05:00
commit 80f8ede0bb
24 changed files with 2316 additions and 0 deletions

2
ach/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.ll
*.o

15
ach/Makefile Normal file
View file

@ -0,0 +1,15 @@
default: simple
%.ll: %.ach
cargo run -- compile $< -o $@ -f llvm
%.o: %.ll
llc $< -o $@ -filetype=obj
%: %.o
clang $< -o $@
.PHONY: clean
clean:
@rm -f *.ll *.o simple

3
ach/functions.ach Normal file
View file

@ -0,0 +1,3 @@
fn id x = x
fn plus x y = x + y
fn main = plus (id 2) 7

1
ach/simple.ach Normal file
View file

@ -0,0 +1 @@
fn main = let x = 2; y = 3 in x + y