4 ms·
If you're writing anything for the browser, then I'll solidly recommend Reason. It works out of the box and ReasonReact is much more ergonomic compared to vanil
by jasim 8y ago
If you're writing anything for the browser, then I'll solidly recommend Reason. It works out of the box and ReasonReact is much more ergonomic compared to vanilla React + ImmutableJS + Redux + TypeScript combo. And there is a growing community around that use case in the Reason world.
If you want to write a command-line application, you can choose either OCaml or Reason, depending on your taste of syntax - both compile to native statically linked binaries. If you're doing anything related to compilers, OCaml is particularly suited for that, and you'll be in very good hands with Menhir (see: https://pl-rants.net/posts/case-for-new-lang/ https://pl-rants.net/posts/case-for-new-lang/). Another systems software written in OCaml is unison (https://github.com/bcpierce00/unison https://github.com/bcpierce00/unison), which is a file synchronization tool with a clear specification.
But if you want to write database backed web application servers in OCaml, with sessions, background jobs, admin interfaces, ORMs, database migrations and all that jazz, then you might want to give F# a go, or Haskell which has a better story around it. I do have a tiny Node server written in Reason that I use as an API endpoint but if I were to build a full-fledged system, there is nothing yet in the OCaml world like Rails or Django.
- laurentl 8y agoThanks for the feedback. At this stage the goal is purely to dabble in FP with "Advent of Code" style mini-programs, and basically opening my developer chakras. An added benefit would be to use this new language at work, which means that the size of the ecosystem (3rd-party modules, frameworks, etc.) can be a factor - one in which I guess OCaml is behind F# and Reason?
- yawaramin 8y agoNote that OCaml and Reason are the same language with a different syntax. So when you're learning one, you're learning the other. There are some ecosystem differences because you can target native compilation, or JavaScript compilation. But otherwise the concepts carry over.
- raegis 8y agoI used Unison for a decade, almost everyday, and it never failed. I never experienced this level of reliability with any other software. Perhaps all the credit goes to the programmer (Benjamin Pierce), not the language, but Unison certainly piqued my interest in Ocaml.