Lumen

functional programming language for .NET

About

Lumen is functional programming language with dynamic typization for .NET Framework platform. It can be easily used as script language in yours .NET projects - Lumen can be embedded into any project on any language from .NET family.

Features

Everything is an expression!

let x = 7
println (if x > 9: "x > 9" else: "x <= 9") //=> "x <= 9"

Pattern matching

let persons = [["Alex", 20], ["Maya", 21]]

for [name, age] in persons:
  print "Name: \(name) Age: \(age)"

Generators

let factorials () =
  let factorial 0 = 1
  let factorial n = n * rec (n - 1)

  for i in 1..inf:
    yield factorial i

// This infinitie loop will be print factorials
for i in factorials ():
  println i

Tail recursion

// Factorial with tail recursion and helper function
let fact n =
  let fact 0 acc = acc
  let fact n acc = tailrec (n-1) (acc*n)
  fact n 1

println (fact 5) //=> 120