tl;dr: I'll be live coding a compiler: twitch.tv/suppipi / playlist on youtube / source code.

Over the next few weeks I will be streaming a few sessions on twitch where I'll be live coding a compiler for a custom language called Strema created especially for this stream.

What is Strema?

Strema is an impure, statically typed, (mostly) functional programming language in the spirit of ML. It will have several features we've come to love such as type inference, first class functions, anonymous records, ADTs and pattern matching.

Here's an example of a Strema program:

type List a =
    | Nil {}
    | Cons { head : a, tail : List a }
end

def length(xs) := do
    case xs of
        | Nil {} -> 0
        | Cons { head = _, tail = rest } -> do
            def res := add(1, length(rest))
            res
        end
    end
end

def main() := do
    ffi("console.log", length(Cons { head = 1, tail = Cons { head = 2, tail = Nil {} } }))
end

The compiler will be written in Haskell and will target JavaScript. JavaScript is a really nice target language for us because it already has records, first class functions and closures, which is all we need to implement our language in a straightforward manner.

Where and when?

I will stream once or twice a week in the european mornings, though I have not set specific days or hours yet. If you'd like to receive a notification when I start streaming, follow me on twitch.tv/suppipi. I will try to update the twitch schedule accordingly as well.

If you missed a session or would like to watch it at your own pace, you can view past sessions on this youtube playlist. The first session is already out where we start by defining a skeleton AST for Strema and JavaScript, translate the Strema AST to JavaScript and pretty print the javascript to text.

The source code for the project is also available on this gitlab repo (and on this github mirror). Feel free to clone and play with it!

streaming picture