Oh so true! That is why I compile only subsets of files at a time to make sure they succeed before I continue to a full compile. I used to use the pImpl idiom well but not as well as I used to recently… >.>
Not a cast, casts are done via <:
, it is just saying that ‘I want to access this module via this signature’ and any module will fit if it fulfills the signature (or more is fine). You could not, for example, cast it to another signature later. But yes OCaml’s module system is…unique is putting it mildly, but amazingly powerful. ^.^
Ooo, I had not, reading, and my comments:
No IDE. I use Merlin and ocp-indent in Emacs to write OCaml code and it sucks. Crashes and hangs ~50x per day. Autocompletion is worthless and there’s no integrated documentation. As a metalanguage, OCaml should be built in harmony with its own IDE written in itself. As is, OCaml development is like pulling teeth compared to F# in Visual Studio.
He sounds like an MS-dev to be honest, looking for a mouse-driven IDE. I’ve never experienced the crashes or hangs he speaks of, autocomplete is, well, beyond amazing for me (I type a single character and it pops up a list of anything that makes sense in that context for the types involved, I’m always amazed at how well it guesses what I want it to be and will be at the top of the list, Visual Studio has never been even close to that accurate even with Visual Assist).
No support for multicore programming.
This I do concede, although there are libraries that work around it well and the compiler has made quite good strides recently at helping this along.
Sucky uniform data representation means almost everything gets boxed, you have weird 31- or 63-bit integers, many basic types are missing (int16, float32, unicode etc.) and the language is incapable of expressing an efficient generic hash table.
Eh, it is not as bad as he says about boxing, the compiler is fantastic at unboxing things during optimization (which is wonderfully visible in output javascript unlike machine code ^.^). The lack of int16 and float32 and unicode is a bit odd and I do wish they existed at times, but the javascript output of bucklescript fits into javascripts world very well (which only has float64 and int32 anyway as supported types without using things like typedarrays).
Gaunt stdlib and many incompatible and incomplete replacements. You can make a set of strings with Set.Make(String) but not with integers because there is no Int module built-in. You can get some of the functionality you need with Batteries Included exclusive or Annexlib exclusive or Jane St Core exclusive or…
The stdlib is very sparse, but that is on purpose as they do not want to force an entire style when it might not be useful for a situation. However, there are two big libraries, Batteries and Core that he mentioned, that are ubiquitous now and work together (Batteries is strictly a subset of Core and remains compatible with Core, Core is… larger in scope, even then neither are necessary, Annexlib I think is dead).
Interpreted REPL. OCaml doesn’t have a JIT compiler. Instead it provides incompatible compilers that either batch compile to native code (no REPL) or interpret bytecode (the REPL). For example, they evaluate function arguments in different orders (left to right for ocamlc and right to left for ocamlopt). There have been native code REPLs but they were unstable and have been abandoned.
OCaml is a compiler, like C or C++, which happens to have a repl (though there are C++ and such repl’s too to be technical, there is a fantastic clang-based one I use at times), but no, it is not a JIT or a VM or anything of the sort, it is a compiled language, not Python or .NET stupidity. And the function arguments are an oddity between the two, but that is only an issue if you are doing order dependent operations within a single expression, which should not be done (as in C++, C++ is random-order arguments as well, and like C++ that is for efficiency on machine code reasons as it is a compiled language designed for speed).
Overall he seems like he is trying to treat OCaml like a VM language instead of a compiled language, that is not OCaml’s purpose or reason for being but rather it is for being a fully type-safe and fast baremetal language, and that shows being that it is on average within twice the speed of C/C++ and can match it as well if programmed for that style. It does not need any massive runtime like .NET or JVM stupidity, compiled to a single distributable binary, easy to cross-compile for other platforms, etc. It is a typed high-level language for a low-level world, which is something that .NET, JVM, Python, etc… do not even approach.
Confronted with all of these major problems Facebook decided to give OCaml a facelift. They didn’t even attempt to address any of the real issues. In fact, they gave OCaml a new user interface in the 21st century that is literally ASCII art in a terminal window:
Yeah I agree there, the only thing Facebook did was add in extra curly braces and added asciiart to the repl, and add JSX into it (ugh…), only one or two small changes I agree with, but it fits into Facebook’s interests, not mine.