The Felix Programming Language

Felix the cat

Felix is a statically-typed, high-performance scripting language that features both a rich type system and a mix of functional, object-oriented, and procedural coding styles, along with a flexible coroutine and threading system, asynchronous I/O, and an extensible grammar defined in user-space.


Click the colored text to see examples.
        // herein lies an RPN calculator, written in Felix
        var prog = "1 1 + 3 * 2 /";
        var acc = 0;
        var st = list[int]();

        for tok in split(prog, ' ') do
            match tok.str with
            | "+" => st = st.tail.head + st.head + st.tail.tail;
            | "-" => st = st.tail.head - st.head + st.tail.tail;
            | "*" => st = st.tail.head * st.head + st.tail.tail;
            | "/" => st = st.tail.head / st.head + st.tail.tail;
            | ?d => st = d.atoi + st;
            endmatch;
        done;

        st.head.println;
        // same as println st.head;
        // ...which is the same as print $ head st;
      

Get it from GitHub!