Hacker News new | past | comments | ask | show | jobs | submit login

You cannot go wrong by picking any statically typed functional language - Reason, Elm, F#, PureScript, Haskell, or even Idris. All of these languages share a similar style of programming that revolve around data that is described through a rich type system and program execution modelled as a series of pure functions that transforms values from one type to another.

For someone new to the Typed FP world though, Reason or Elm would be an easier starting point. Both communities are geared towards newcomers and have first-class support for front-end development.

My brief foray into Elm was very pleasant, and it is a community with great taste and aesthetics. Evan Czaplicki is wise beyond his age and is building a language that will last a long time. One reason why I would reach for ReasonML than Elm however is Reason's zero-overhead interop with Javascript. You can do this right in the middle of your code `[%%bs.raw console.log ("hey")];` and nobody will complain. This interop allows Reason to utilize the vast NPM ecosystem - so you can gradually adopt Reason in your front-end codebase. Your ReactReason code can use your plain React components and vice versa, and you can even use the bs-express library to write NodeJS applications with ExpressJS.

Elm aims to remain pure because it allows them to build a more solid ecosystem in the long run. It is a great choice as well, just that the shorter-term trade-offs make it slightly more difficult to work with existing Javascript code.

One angle in which Reason would be a better beginner language than Haskell is the number of concepts you have to understand before you can be truly productive with it. The shift from an imperative, dynamic world to a functional, statically typed world is already difficult enough. Reason/OCaml makes this transition easier because with it you can program in the familiar imperative style when you want, unlike Haskell where you need to rely on the elegant but takes-some-effort-to-grok Monads to tackle the Awkward Squad of I/O (https://www.microsoft.com/en-us/research/wp-content/uploads/...). And this might be controversial opinion - but the historical roots of Haskell as a language for bleeding-edge academic experimentation has lead to a certain kind of fragmentation that demands more effort from newcomers than a made-for-industry language would need. PureScript and Idris however have standardized on many of these things and might not share the same concerns. You still have to content with its laziness and purity. These are both practical and aesthetic choice in how to program, and they are very fun to explore. You just need to get started on some language in the statically typed FP camp to appreciate this long, deep rabbithole!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: