https://github.com/igi-111/jack
A toy ML dialect
https://github.com/igi-111/jack
compiler cranelift ml rust type-checking
Last synced: 6 months ago
JSON representation
A toy ML dialect
- Host: GitHub
- URL: https://github.com/igi-111/jack
- Owner: IGI-111
- Created: 2019-07-12T16:21:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T01:02:08.000Z (over 4 years ago)
- Last Synced: 2024-11-01T05:02:32.306Z (11 months ago)
- Topics: compiler, cranelift, ml, rust, type-checking
- Language: Rust
- Homepage:
- Size: 91.8 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jack
Jack is a compiled, statically typed, pure-functional programming language inspired by ML.
This repository hosts a 3-step compiler written in Rust that does parsing, semantic analysis (including type checking) and generates Cranelift IR.
Here's an example of a Jack program you can run using `cargo run fib.ml`
```ml
fun fib(n: int): int =
if n == 0 then
0
else if n == 1 then
1
else
fib(n-1) + fib(n-2)fun main(): bool = let fib9 = fib(9) in fib9 == 34
```