mimsa
Mimsa is a small programming language.
It is inspired syntactically by Elm
and Haskell
.
It works by saving expressions into a database and referencing them by hashes like Unison
.
It can be used through a repl
or it's own web-based editor.
It compiles to readable Javascript.
It aims to become a specialised DSL for small backend services, much like Elm
is for frontends, however currently it's just a fun way to play with functional programming without installing anything.
Try it at mimsa.isverymuchmybusiness.com
Getting started
Scratch
When you open Mimsa, you'll see the Scratch
screen. This is like a repl where you can try out expressions.
Let's try making a simple expression:
Note that now we have some input, the Evaluate
button has appeared. Let's click it:
It's evaluated the expression, 20
, in pink, and the type of the expression, Int
, in blue. Note we have not had to mention any types - in Mimsa they are all inferred.
Exploring expressions
At the bottom of the screen we have a set of names. These are all the expressions bound to names in our project.
If we click on any of them we can view the code for the expression.
We can change the code here, and even press Update
to save a new expression and bind it to the name. This means any new users of the function will use your new version, but any old versions will still use the old version of the function.
Note the Compile export
button - this allows us to turn this expression into Javascript and download it. Export
is the default runtime which just exports the function. There are a few other runtimes which allow Mimsa to do various side effects (more on this stuff soon).
There is more info on the syntax.