Author here, I originally posted this to https://www.reddit.com/r/ocaml to gather some feedback prior to posting it here. It was a surprised when my boss told me "Hey, you're top 10 on HN right now". Glad to know someone liked it enough to post it here before I could :)
It's something I've been working on for quite a while, because I wanted to answer the question "Why do you like OCaml so much and why should I care?" once and for all. Hope you enjoy it.
Speaking of OCaml, all the traffic going to my blog is going through HARchiver [0], a very high performance proxy and reverse-proxy 100% written in OCaml that gathers datapoints for use with Mashape Analytics [1]. Disclaimer, I work at Mashape.
Small nitpick: 'unit' is more like 'void' than 'null'. Think of a procedure that returns nothing in C: it returns void, similarly in OCaml you return unit. I think the equivalent of 'null' would be None, if you think of pointers as 'a option, except you have to handle it explicitly and can't get NullPointerException like you mention.
I'm not sure. Void is not a real value, whereas unit is (unlike the article states) just a normal value, which supports all the things you can do with values, like assigning/let-binding etc.
While at it, let me add some more comments to the article, since the OP was asking for input:
> In Java and JavaScript, any object can be null and it leads to Null Pointer Exceptions at runtime.
I know what is meant, but that is really strangely written, since the only object that can be null is null itself. In JS to pick your example, {} can never be null.
> There are two different forms: SUM types and PRODUCT types
This comes after introducing tuples which are also product types, they even have multiplication signs in their type signature :-)
> SUM types in OCaml are called Variants.
You could note that enums are sort-of-kind-of sum types in C.
Also, you should probably emphasize that your examples use Core which is not the standard library, because the standard library has completely different signatures, has no Option module, etc. You should probably add the relevant open line, otherwise it is confusing for people that some of the examples don't work and produce complicated error messages.
> I'm not sure. Void is not a real value, whereas unit is (unlike the article states) just a normal value, which supports all the things you can do with values, like assigning/let-binding etc.
This is true, but null is effectively at the bottom of the inheritance hierarchy in that it is a valid value for any (pointer) type (in C/C++/Java etc.), while unit cannot be used that way. The relationship between unit and void is that if you were porting a program from an imperative language with void to OCaml, you would generally replace any place where you returned void or took no arguments/void as the argument with unit. Like void it conveys no real information.
Speaking of OCaml, I'm currently working through the Real World OCaml book [1] by Yaron Minsky, Anil Madhavapeddy and Jason Hickey, who are some of the drivers of using OCaml in production settings (Yaron Minsky works for Jane Street, who aside from being a quant firm are also the developers of the popular Core alternative standard library).
gnuplot.info works for me on IPv6 but not on IPv4 (get connection reset on IPv4), seems to be a problem with projects.sourceforge.net.
gnuplot.info has address 216.34.181.96
gnuplot.info has IPv6 address 2001:468:c80:a202:0:b074:0:c082
96.181.34.216.in-addr.arpa. 3567 IN PTR projects.sourceforge.net.
This site has a different IP and seems to point to a DNS server/proxy:
simongrondin.name has address 176.58.120.112
112.120.58.176.in-addr.arpa. 85642 IN PTR unblock.us.org.
It's something I've been working on for quite a while, because I wanted to answer the question "Why do you like OCaml so much and why should I care?" once and for all. Hope you enjoy it.
Speaking of OCaml, all the traffic going to my blog is going through HARchiver [0], a very high performance proxy and reverse-proxy 100% written in OCaml that gathers datapoints for use with Mashape Analytics [1]. Disclaimer, I work at Mashape.
[0] https://github.com/Mashape/HARchiver
[1] https://www.apianalytics.com/