Programming in Elm - Part 1 Kick off

I decided to write a series about the experiences I had writing an Elm app during the last couple of months. I am trying to add a new post every one or two weeks.

The app I rewrote is is a BMI, body-index and body fat percentage calculator, that can be used to check if your weight is in a healthy range or track fitness progress. You can take take a look at:

Motivation

I wrote the app for my self to track my personal results during certain kind of fitness trainings over weeks / months. That was more than 4 years ago. It was written in Ruby on Rails as a backend-centric app. Recently I wanted to add one or two new features and realized that most of my users use mobile devices and the page is not at all mobile friendly. So I thought it could be a fun training project, which also makes things nicer the people already using the app.

Client side App

This site is a great example of an app that can be done almost completely on the client side. Originally I was afraid of writing everything client side, but that was 2012 and testing and other libraries for Javascript where just not there yet.

Elm for the win

I decided to write the new version in Elm, using the great elm-mdl library for mobile support. I picked Elm because I like it for its type system, package system, error messages and tooling. … As well as the great community that I experienced as very kind and helpful.

I also thought about using Clojure + ClojureScript + Om, but even though I really like Clojure, I wanted to try a ML like type system on a bigger project. I could have also used Purescript, but my knowledge of advanced type systems is limited, therefore I thought Elm would be the easier language to start with.

2-3 months later

I am very happy that I was able to implement all the features that existed in the original version. It was a lot of fun and I enjoyed writing Elm code almost every day. However it was a lot of work. I underestimated the work that is necessary to learn language, a new eco system and write a “private production” app in it.

Whats next

Thanks for reading this intro. Next I will get more technical and report about my biggest learnings about Elm and related things … and there where a lot. I will cover “temporarily narrowing error types”, “fuzz testing”, and much more.

Dennis Sivia

Dennis Sivia
I am passionate about technology and especially having a lot of fun with functional programming and computer science.

Getting started with Raspberry PI 3, Python and Elixir

Setup for implementing various raspberry sensors setups using elixir and python Continue reading

Elixir, Phoenix 1.3 , Elm and Webpack 3

Published on November 01, 2017

Prettier and Spacemacs

Published on October 31, 2017