[WIP] A statically typed, functional programming language.
square x = x * x
hypotenuse x y = sqrt (square x + square y)
hypotenuse 3 4
(**) x y = hypotenuse x y
3 + (5 ** 6) / 2
add5 = (+) 5
times2 = (*) 2
7 |> times2 |> add5
add5_and_times2 = add5 >> times2
add5_and_times2 10
max x y = if x > y then x else y
min x y = if x < y then x else y
max 5 -7
min 6.8 2.7
add1 = x -> x + 1
add1 5
Loads module from ./examples/math.fw
import examples::math
eq_root1 1.0 3.0 2.0
fib n = if n < 1 then 1 else fib (n - 1) + fib (n - 2)
The last statement is the return value.
x = {
a = 1;
b = 2;
a + b
}
some_function x y = {
a = x * x;
b = y * y;
a + b
}
Install the Rust programming language:
Clone this repository:
git clone git@github.com:luizgabriel/FlowLang.git
cd FlowLang
Run the REPL (Read Evaluate Parse Loop) with:
cargo run -p repl -q