3 ms·
The best way to setup OCaml (native) is to follow https://github.com/janestreet/install-ocaml https://github.com/janestreet/install-ocaml. If you're following R
by jasim 8y ago
The best way to setup OCaml (native) is to follow https://github.com/janestreet/install-ocaml https://github.com/janestreet/install-ocaml. If you're following Real World OCaml, the stdlib they use is Jane Street's Core/Base, which is quite comprehensive compared to the one shipped with the language. Mixing and matching the book with the language's own stdlib can cause a lot of heartburn.
There is also a lot of work going on in making the OCaml native development experience easier. install-ocaml (link above) actually takes you through building and testing a project using Dune (formerly JBuilder) which is fast becoming the standard way to build OCaml projects.
If you are however interested in just the language, you can get wonderful ergonomics by using BuckleScript/ReasonML. You'll be running your code using Node, or in the browser, and you'll get access to the large and wild npm ecosystem. You'll lose out on the native OCaml ecosystem, but there are attempts to meld both together.
If none of this is your cup of tea, then you have a great alternative in F# - it is Microsoft's attempt at OCaml, and has a few great features that are not present in the original language. It comes with great Visual Studio IDE integration and sits in the .net ecosystem like Clojure or Scala does in the JVM ecosystem.
Or you can use Elm or PureScript which are statically typed functional programming languages that run on the browser, or Haskell, or even Idris.
These languages have great differences between them, but all of them are ultimately statically typed functional programming languages. Julia is not. Typed FP gives you ADT, immutability by default, functions as first-class constructs, and lets you model complex software as just pure transformations of data. These things are worth learning just for them, and once you understand the motivations behind them well enough, the occasional jank would be but minor annoyances.
- totalperspectiv 8y agoI'll definitely be giving it a try again at some point in the future, or one of the alternatives. I learned a ton even just dipping my toe in the waters.