Step-by-Step Guide to Manage OCaml Installations With asdf
Use asdf to manage opam (and OCaml)
asdf is a command-line tool which allows you to install multiple versions of a programming language.
With asdf you have absolute control over which language version gets installed on your system.
You can also switch between different versions. That’s useful if you work with several projects that might use different versions.
I wrote about asdf a while ago. In this post, I will go over the steps on how to manage OCaml via asdf.
TIL: Typescript Still Coerces Types
Here’s a simple TypeScript function:
function f() { const a = 2 const b = 'a string' return a + b } What I expected:
TypeScript can infer types. It will recognize that a is of type number and b is of type string.
I expected a type error, because I try to add a string to a number.
You can also be more explicit and tell TypeScript the types. Like so:
Use asdf to Manage Multiple Versions of Languages
I normally use Arch’s package management to install new languages and environments. The package manager is mostly up-to-date and easy to use.
If you run a system-wide update, it also installs new versions of a package.
The Problem Some repositories on my machine use older versions of Node or Elixir.
When I run those applications, I might get errors.
Sometimes Arch packages don’t use the latest version. For example, the Elixir installation uses version 1.
Setup OCaml With NeoVim
How to use the NeoVim text editor as your Ocaml IDE
Why OCaml? I’ve always been interested in learning an ML language. But Haskell, the poster child of functional programming, has a high learning curve.
OCaml and ReasonML (an alternative syntax for OCaml) are much more beginner-friendly.
I started a free MOOC on functional programming with OCaml a few days ago. Thus, it’s the perfect time to set up my editor for OCaml development.
How To Learn OCaml
A starting point for learning OCaml - a functional, type-safe, expressive, and battle-proven language
Why OCaml? OCaml is an open-source functional, statically typed, and mature language. If you want to learn such a paradigm, OCaml is far more beginner-friendly than Haskell.
OCaml has a blazingly fast compiler and excellent type inference. It offers exhaustive pattern-matching, which makes your programs concise and a joy to work with.
I’ve come to OCaml from ReasonML, a JavaScript-like syntax, and tool-chain for OCaml.
Free Functional Programming Course With OCaml
Today I discovered a free MOOC for Functional Programming in OCaml.
The course is offered by a French platform, FUN-MOOC.
You can attend Introduction to Functional Programming in OCaml for free (after you sign up for an account).
The course is in English and runs for a few weeks until end of December 2019.
I am interested in learning more about OCaml after programming a few simple applications in ReasonML. Reason is an alternative syntax for OCaml, and I’ve come to appreciate its type-safety and programming paradigms.