Kiwi is a little programming language. It is dynamically typed and interpreted.
Try it on the Kiwi playground!
fun fib(n) {
if n < 2 {
n
} else {
fib(n - 1) + fib(n - 2)
}
}
print "Calculating fib(15)"
print fib(15)
The Kiwi VM supports expressions, basic types (Boolean
, String
, Double
and
Integer
) and local variables.
I’ve worked through some iterations of Kiwi, and they’re in different branches:
- main: Version currently being worked on. Dynamically typed, interpreted and meant to eventually have a JIT. The VM is written in Nim and the parser/scanner are written in TypeScript.
- llvm: Version I worked in the past and am still experimenting with. Statically typed and compiled to native code with LLVM. It is far from finished; right now only floating point types are working (writing a type system is hard!) and there are expressions, if-else conditions and while loops.