A small, portable language, for making reliable applications


Minimal, yet flexible

The syntax and semantics of Play is heavily inspired by Forth. This means that the syntax is clean and free of many control characters while the semantics consist of few, but powerful, rules.

                # Returns 3

                def: main
                : 2 increment

                def: increment
                : 1 +

Without going into too much detail, code in Play consists of whitespace-separated functions which are called in a left-to-right fashion. The return value, or values, of a function call serve as the input arguments for the next function call. Numbers are functions which return themselves. Technically, this entire paragraph is valid Play syntax.

Easy to reason about

Play also improves on Forth in several ways. A strong, static type system helps you prevent bugs and to document your code. Errors and IO are represented in the type system, so that forgetting to deal with a certain error condition is caught at compile time. All data structures in Play are also immutable, which greatly reduces the number of states your program can be in, which again makes your code easy to reason about.

                Compilation failed:

                9 | def: some-word
                10| type: -- Bool
                11| : 1

                The type of 'some-word' is specified to be  -- Bool.
                However, it seems that the actual type is:  -- Int.


Your code can run on the command line, on a server or even in the browser. As Play is compiled to web assembly, you're sure to enjoy the exact same semantics wherever your code is executed.

In Alpha

Play is still in early development. There are currently no strings, arrays or even garbage collection. All of this will come in time. For more information, take a look at the roadmap.