Live data from Hacker News

Exploring ReasonML and functional programming

reasonmlhub.com

1–10 of 65 posts

Re: Exploring ReasonML and functional programming

#4
FYI for anyone who was fuzzy on the license/patent situation with the project:

https://github.com/facebook/reason/commit/e8fb73ec6ff7c31367...

(As of 12/2017, relicensed to straight MIT from BSD+patent.)

Rauschmayer's work here makes me interested in the language and motivated to learn it. After reading more, only wish I'd explored for a recent project where I was working to implement a lot of functional patterns in native JS.

Any thoughts about ReasonML vs "straight" OCaml? (Or does that question even make sense?)

Re: Exploring ReasonML and functional programming

#5
post #4

FYI for anyone who was fuzzy on the license/patent situation with the project: https://github.com/facebook/reason/commit/e8fb73ec6ff7c31367... (As of 12/2017, relicensed to straight MIT from BSD+patent.) Rauschmayer's work here makes me interested in the language and motivated to learn it. After reading more, only wish I'd explored for a recent project where I was working to implement a lot of functional patterns in…

Someone can correct me, but Reason is just a syntax on top of Ocaml's compiler. Bucklescript and Reason even share the same site design. there's not much of a choice beyond what you like more, as they use the same libraries, tools, etc.

Does anyone know where this new wave of interest came from?

Re: Exploring ReasonML and functional programming

#6
post #3

Why should someone unfamiliar with functional style programming be learning ReasonML rather than say, something like, haskell? Looking for concrete, technical answers.

You wouldn't choose it over haskell every time, but for the limited subset of times where you need to write frontend code ReasonML has distinct advantages.

ReasonML is basically OCaml that compiles to JS, designed to make interoperation with Javasascript easy. There are compile to JS projects for Haskell too, but the ease of interoperability with popular JS libraries like react and support from facebook's open source tooling chain make it a much better choice for most frontend projects IMHO -- unless you're already a haskell expert in which case go with what you already know!

Re: Exploring ReasonML and functional programming

#7
post #3

Why should someone unfamiliar with functional style programming be learning ReasonML rather than say, something like, haskell? Looking for concrete, technical answers.

when I started out to learn functional style programming I wanted to build a real project. I tried several languages out and I settled with F# because I just didn't like the enforced purity of Haskell and laziness as a default.

It just cost me so much time to constantly think about IO that I was barely figuring out what I wanted to write. It seemed impractical to me and now with some more experience I still think it is. Ocaml type languages strike a better balance in my opinion if you're interacting with the world.

Re: Exploring ReasonML and functional programming

#8
post #3

Why should someone unfamiliar with functional style programming be learning ReasonML rather than say, something like, haskell? Looking for concrete, technical answers.

You wouldn't choose it over haskell every time, but for the limited subset of times where you need to write frontend code ReasonML has distinct advantages. ReasonML is basically OCaml that compiles to JS, designed to make interoperation with Javasascript easy. There are compile to JS projects for Haskell too, but the ease of interoperability with popular JS libraries like react and support from facebook's open source…

That's not correct. What you've described is Bucklescript (which has OCaml syntax). ReasonML is an attempt to "improve" the OCaml syntax to something more familiar to folks coming from C-style family of lanauges. ReasonML can be used with both the Bucklescript compiler (which compiles to JS) -or- the standard OCaml one (which compiles to native).

Re: Exploring ReasonML and functional programming

#10
Someone will have to explain why I might pick ReasonML over Elm for front-end development. Elm's community seems very focused on making front-end development as intuitive and hassle-free as possible. ReasonML seems like Facebook just wanted to leverage a pre-existing community but couldn't bring themselves to adopt the syntax so rewrote it in-house.
Post reply on HN