|
Doc
|
Please see C++ implementation of the language.
IMPure functionAl LAnguage is a high-level, dynamically- and strongly-typed, functional programming language that runs on a virtual machine. Impala is my highschool Computer Science project written in Rust.
Almost nothing works currently...
See TODO list
range := import("range")
{if: if} := import("std")
// bubble sort
func bubble_sort!(list)
range.range(0, len(list)) |> range.each() <~ (_, i)
range.range(0, len(list)-i-1) |> range.each() <~ (_, j)
if(list.j > list.(j+1)) <~
[list.j, list.(j+1)] = [list.(j+1), list.j]
list := [-2, 4, 2, 1, 0, 5, -1, 6]
bubble_sort!(list)
println(list) // [-2, -1, 0, 1, 2, 4, 5, 6]
std := import("std")
fmt := import("fmt")
// fibonacci
func fib(n) n <= 1 : n ? fib(n-1) + fib(n-2)
std.range(0, 10) |> std.each() <~ (i, _)
fmt.println("fib({}) = {}", i, fib(i))