<story><title>A brief introduction to OCaml</title><url>http://www.lexicallyscoped.com/2015/06/06/intro-to-ocaml.html</url></story><parent_chain></parent_chain><comment><author>rubiquity</author><text>It&amp;#x27;s cool to see a link about learning OCaml so high on HN. I started teaching myself OCaml a few months ago and I really like it. Here&amp;#x27;s a few things I like so far and why I think anyone that uses Go or Rust should give OCaml a look:&lt;p&gt;1. OCaml compiles to a binary like Go and Rust do&lt;p&gt;2. The type system is helpful without being a huge burden on learning&amp;#x2F;productivity (unlike Rust and Haskell)&lt;p&gt;3. Garbage collection&lt;p&gt;4. Pattern matching and algebraic data types (like Rust)&lt;p&gt;5. OCaml is plenty fast at CPU bound work(slower than Rust, faster than Go) despite not being parallel (yet)&lt;p&gt;Those are my takeaways of what I enjoy about OCaml so far. It has been the most approachable typed functional language that I&amp;#x27;ve looked at yet! Depending on the type of things you want to learn and problems you want to solve, Your Mileage May Vary.</text></comment>
<story><title>A brief introduction to OCaml</title><url>http://www.lexicallyscoped.com/2015/06/06/intro-to-ocaml.html</url></story><parent_chain></parent_chain><comment><author>jordwalke</author><text>This is also great cheat sheet for someone still getting used to the OCaml syntax.&lt;p&gt;I usually advise people to pretend that double semicolons don&amp;#x27;t exist for anything but the interactive top level. In source files, you can forget about double semis entirely as long as you just remember to always assign the result of an imperative statement to the dummy &amp;quot;_&amp;quot; name.&lt;p&gt;&lt;pre&gt;&lt;code&gt;    let _ = print_string &amp;quot;hi&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
Then you can think of ;;&amp;lt;enter&amp;gt; as merely a fancy way of hitting the return key in the interactive REPL. There&amp;#x27;s also a way to use a different key mapping (control+enter) instead of ;; in utop, so there would be no reason to even acknowledge the existence of double semis.
&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;diml&amp;#x2F;utop&amp;#x2F;issues&amp;#x2F;131&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;diml&amp;#x2F;utop&amp;#x2F;issues&amp;#x2F;131&lt;/a&gt;</text></comment>