🏠 back to Observable

Elm instead of JS?

Please get me right, I’m in love with Observable. Yet, pondering certain twists just make me wonder. So I’m just wondering, no big deal. My Haskell-fan son just learned Elm and triggered my wonder.

How would an Elm-based version of Observable be better or worse than the current JS-besed version?

From An Introduction to Elm: “some things you can only get from a functional language like Elm:

  • No runtime errors in practice.
  • Friendly error messages.
  • Reliable refactoring.
  • Automatically enforced semantic versioning for all Elm packages.”

It seems like it’s possible to run the compiler by calling a server from a browser (like the Try Elm page does), but I don’t think there’s a way to run the compiler itself in the browser yet. If that’s developed, it would most likely be possible to create an elm template tag that you could use like so:

text = "Hello!"

// renders an HTML element containing “Hello!”
import Html exposing (text)

main =
  text ${text}