Exploring 4 Languages

Rust, Elm, Reason, and F♯ – a bunch of cousins!

Today, as I hit the first of the implementation chapters in Domain Modeling Made Functional, I started thinking about how I wanted to implement it. As I’ve noted elsewhere in the past, very little of the book is truly specific to F♯, though that’s the language Wlaschin uses in the book—and Wlaschin himself agrees:

Thanks! Yes, it’s true that you could easily use #ElmLang, #RustLang, #Scala, or especially #OCaml to work through the book. I use hardly any F# specific features.

So… I decided to try something a little bit bonkers. I’m going to implement these exercises in four different languages:

These languages are all related: they’re descended from Standard ML. ReasonML and F♯ are like siblings: Reason is merely a custom syntax for OCaml; F♯ is (originally) an implementation of OCaml on .NET (though the two languages have diverged since F♯ came into existence). Elm and Rust are cousins of each other and of Reason and F♯, though they’re both drawing on other languages besides OCaml as well. I also have some familiarity with Rust, Elm, and F♯ already, and have read the docs for Reason a couple times. So this is a bit less crazy than it might otherwise be.

Why, though? Mostly because I think it’ll be interesting to compare the implementations of the domain model from the book side by side. It’ll look just a bit different in each language, and I expect to learn a bit more of the feel of each language by doing this. (That side by side comparison is something I’ve done before and found very profitable.) I’ll also turn it into blog posts, which hopefully will be interesting to others!