Initial commit
This commit is contained in:
commit
80f8ede0bb
24 changed files with 2316 additions and 0 deletions
2
ach/.gitignore
vendored
Normal file
2
ach/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*.ll
|
||||
*.o
|
||||
15
ach/Makefile
Normal file
15
ach/Makefile
Normal 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
3
ach/functions.ach
Normal 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
1
ach/simple.ach
Normal file
|
|
@ -0,0 +1 @@
|
|||
fn main = let x = 2; y = 3 in x + y
|
||||
Loading…
Add table
Add a link
Reference in a new issue