Why We Use OCaml
I&#x27;m not a user of OCaml, but here is a counter-argument for C#:<p><i>First-class functions</i><p>C# has closures, and can pass function pointers with delegates.<p>--<p><i>immutability is the default</i><p><i>Mutability can be a useful tool in some situations, but it is often unnecessary and potentially harmful.</i><p>I think this point has probably been argued to death by now, but I still can&#x27;t see this as a good idea. &#x27;Side effects&#x27; are really just a reality of software development. For example if I want to fade in a GUI element on a page, I don&#x27;t want to create a new element for every transition change. Theres nothing wrong with mutable state, but it is nice to have immutability for <i>some</i> use cases. In this case c# has valuetypes, and the const&#x2F;readonly modifiers.<p>--<p><i>Strong static type checking</i><p>Yep C# has had this since the beginning. And you can even use &#x27;dynamic&#x27; if you really want which moves all type checking to runtime.<p>--<p><i>Algebraic data types and pattern-matching</i><p>I feel like these are more buzz words than actual substance. The Html example given also doesn&#x27;t seem exactly clear to me how the operations are being performed. Here&#x27;s a pseudo c# way of doing it:<p><pre><code>    rootHtmlElement
        .SelfAndDescendants()
        .OfType&lt;DivElement&gt;()
        .Where(d =&gt; d.Attrs[&quot;class&quot;] == &quot;foo&quot; || d.Attrs[&quot;class&quot;] == &quot;bar&quot;)
        .Select(d =&gt; d.ChildElements.OfType&lt;TextElement&gt;().FirstOfDefault())
</code></pre>
<i>the typical object-oriented implementation of this in Java would involve multiple subclasses of a common base class.</i><p>I assume they mean that all element types would inherit from a base IHtmlElement? This seems like a good thing to me.<p>--<p><i>Type inference</i><p>Again C# has these abilities with &#x27;var a = 0&#x27; for example. It won&#x27;t infer method return types, not because it couldn&#x27;t, but because it&#x27;s just generally clearer to have the explicit return type written there in the code for the reader.<p>--<p><i>a replay-capable debugger</i><p>C# has intelliTrace for this. Though I expect both suffer from the same problems, slow execution while in use, and huge memory footprint.