Play: A new programming language. Compiler written in Elm

Today is the first release of Play, a new programming language which is statically typed and compiles to web assembly.

Sharing it here as the compiler is written in Elm. I’ll probably do a write up in a couple of weeks how Elm influenced Play.

Play website


Cool! What was your intention to create this ?

In the beginning my intention was to experiment and have fun. But right now I’m hoping trying to turn this into a general purpose programming language which can be useful for CLI, backend and frontend programming.


That is very cool.

I am curious, did you generate the web assembly output from Elm too? Is this a binary output? Or does it output web assembly op-codes to a text file, and then you run it through some web assembly assembler/linker step from there? (I have no idea really about web assembly so perhaps that is not even how its tool chain works…).

Just curious, as some code in Elm for generated web assembly could be interesting… :slight_smile:

The compiler outputs web assembly text format, which is then converted into binary format by a js-library and loaded into the browser (compiling from files is the focus of alpha-2).

The compiler could’ve compiled to binary wasm directly, but text is a bit easier to debug for a human.

1 Like

Very cool! I only recently learned about Forth but I thought it was really neat, so I’m happy to see this. I’m curious, what made you choose Elm to write the compiler in?

Two reasons:

  1. I love Elm and try to use it for as much as I can.

  2. Play is going to have a similar runtime as Elm (immutable, controlled side effects), and since the long term goal is to implement Play in Play, it seemed like a good idea that the first implementation of the compiler followed many of the same restrictions.

1 Like

Totally OT, but I’m glad I hear somebody else voicing this. :sweat_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.