Why OCaml? It's a great language to write programs that works on complex data structures, e.g. ASTs. This choice was actually not very original: people in academia at stanford, berkeley, Microsoft research used OCaml for program analysis (CCured, Saturn, CIL, SLAM). And now and now the industry is also using it (Facebook Infer, Facebook Hack/Flow/Pyre, MS Static Device Verifier, etc.)
I think it's more related to Prolog than functions. In prolog you can use a predicate in many ways. For example append(L1, L2, L3) declared that the concatenation of the list L1 and L2 result in L3, but you can use it in a "reverse" way too (thx to Prolog awesomeness) like append(L1, L2, [1,2,3]) and Prolog will enumerate all possibilities for L1 and L2. This can be slow though, and I think 'mode' is a way to declare all this different way to use prediate (in, int, out), (out, out, in), etc. and maybe compile things efficiently. See https://www.mercurylang.org/information/doc-latest/mercury_r...
Regarding the tangle barrier issue, there is a tool that helps: https://github.com/aryx/syncweb
It allows to modify both the original WEB document and code and keep them in sync.
99% of the computer graphics you see on your screen everyday are made of simple lines, circles, curves, and text in 2D. 3D is useful mostly for games, movies, and CAD software. I don't understand this over focus on 3D. I think the latest edition of "Computer Graphics: principles and practice" does not even teach bresenham anymore. This seems wrong to me.
There are many ways to avoid the boilerplate you mention.
The deriving ppx extension is one of them. I personaly used
my own poor's-man-deriving called ocamltarzan which I used in pfff to factorize boilerplate by using auto-generated visitors. See https://github.com/facebook/pfff/blob/master/lang_php/parsin...