DEV Community

Niels Bom
Niels Bom

Posted on • Updated on

Dark (lang): built with OCaml/ReasonML/Bucklescript, inspired by Elm

Dark is a not-yet-released language/platform/toolchain about which I wrote a post before.

Paul Biggar, the founder of Dark wrote another post in which he gave some details and shared open source standard library they use. (Tablecloth)

Dark is using an OCaml-based tech stack, with OCaml on the backend. OCaml is a not-that-well-known language from the ML family of languages, with languages like Clojure, Elm, F#, F*, Haskell, Idris, Miranda, Erlang, Rust and Scala. This family of languages is very "functional".

On the frontend Dark uses an Elm-inspired architecture written in ReasonML. ReasonML is some form of OCaml (same abstract syntax tree afaik) where Bucklescript is the tool that can convert ReasonML code into JavaScript. Bucklescript can also convert OCaml into JavaScript but ReasonML looks more familiar to people that already know JavaScript.

Main points:

  • OCaml is a great language, as far as I can tell
  • the Elm architecture is a great idea, the Redux part of React copied it
  • ReasonML is open source, but heavily supported and stimulated by Facebook, which has certain drawbacks I think

Personally I've dabbled with ReasonML and ReasonReact but to me the tooling around it and the error messages through the 3 leaky layers of abstraction were a bit much. So I'm putting my money on pure Elm (which isn't without its disadvantages either).

I'm looking forward to see more of what Dark will share.
I'd also like to hear your thoughts.

Top comments (5)

Collapse
 
rhymes profile image
rhymes

Hi Niels, I don't know much about ML languages but I'm very intrigued by the idea behind Dark as I've told in the previous post. It's cool that they are building on established tools, even if it's all kind of experimental now :)

BTW you can make posts become a series so that they can easily be found from each other.

If you're using the editor v1 you can just add series: series name in the front matter of each post and they will magically be linked to each other. If you're using editor v2 you can press the ... button near the images button and add the series name there :)

Collapse
 
nielsbom profile image
Niels Bom

Hey thanks about the series tip!

Collapse
 
rhymes profile image
rhymes

Last tip: you can add #dark or #darklang to the articles, so they can be found by tag as well :D

Collapse
 
yawaramin profile image
Yawar Amin • Edited

Hi Niels, it's not totally accurate to say that React basically copied [Elm] (in a watered down way imho). This is because if you look at React's history, it was deployed internally at Facebook in 2011. And if you look at Elm's history, it was initially designed in 2012, using a quite different paradigm (functional reactive programming) than it is using today. In fact I would say Elm took inspiration from the one-way dataflow idea that React popularized when it greatly simplified its event handling approach and decided to say farewell to FRP.

It is true though that Redux, the state management library, was inspired by Elm.

Collapse
 
nielsbom profile image
Niels Bom

Hey Yawar,

Thank you for correcting me on that. And doing so in a very respectful way.
I'll update the post to reflect that.