From 5616a7d15d7a45e102410a83d6478ea63ce1403c Mon Sep 17 00:00:00 2001 From: azur Date: Wed, 5 Jul 2023 16:17:09 +0700 Subject: [PATCH] Factorial example --- README.md | 9 ++++++++- example/factorial.hlm | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 example/factorial.hlm diff --git a/README.md b/README.md index d82a80e..4c131af 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,14 @@ Holymer is a programming language -It's pretty boring right now so come back later :D +## Status +- [x] Parser +- [x] Typechecker +- [x] IR +- [ ] Optimizer +- [ ] Complier + +The IR output can sometimes be run with scheme interpreter, sometimes. ## Contributing You need to have [Rust Toolchain](https://github.com/rust-lang/rust) installed on your machine before building it. diff --git a/example/factorial.hlm b/example/factorial.hlm new file mode 100644 index 0000000..db06bf2 --- /dev/null +++ b/example/factorial.hlm @@ -0,0 +1,7 @@ +let factorial = fun (n Int) Int -> + if n > 1 + then n * factorial(n - 1) + else 1 +; + +factorial(5); \ No newline at end of file