Z-flat is a programming language created in 2021 by Adam Hutchings.
#2197on PLDB | 3Years Old |
git clone https://github.com/adamhutchings/zflat
Z-flat is a compiled, statically-typed programming language. Its design goals are intuitive syntax, type-safety, and easy library management.
~/ factorial /~
~ recursive implementation ~
factorial_r(x: int): int {
if (x < 2) {
return 1;
} else {
return x * factorial_r(x - 1);
}
}
~ iterative implementation ~
factorial_i(x: int): int {
ret: int = 1;
loop(x): i: int {
ret *= (i + 1);
}
return ret;
}