4 ms·
Are you trying to prove the C++ analogy? http://stackoverflow.com/questions/3073642/official-c-language-subsets http://stackoverflow.com/questions/3073642/offic
by fhars 11y ago
Are you trying to prove the C++ analogy? http://stackoverflow.com/questions/3073642/official-c-language-subsets http://stackoverflow.com/questions/3073642/official-c-langua...
- zem 11y agoi upvoted on the theory that that was deliberate :) the internet needs more understated hunour
- nickpsecurity 11y agoSorry to disappoint. Agree the Internet needs more of that. Makes it funnier when people don't get it, start a tangent, and get called on it in an epic way haha.
- Drup 11y agoThere is a small difference though: Using those various OCaml features is not going to instantly kill you. With the deprecated features of C++, I'm not so sure.
- fhars 11y agoWell, of course. The whole of ocaml is still a smaller language than anybody's recommended 20% subset of C++.
- nickpsecurity 11y agoWay more power/features with the detailed description of those + library + tools + more = 588 pages. C++ programming language 3rd edition is 1,000+ pages. So, not quite that ratio but clearly one has better signal-to-noise ratio and design than the other. ;)
- nickpsecurity 11y agoA while back, I had to decide which of SML or Ocaml I'd recommend to people interested. I looked up comparisons hopefully from talented developers. Found this one by Chlipala: http://adam.chlipala.net/mlcomp/ http://adam.chlipala.net/mlcomp/ A C and C++ analogy doesn't make sense unless you really cherry-picking. A better analogy would be Wirth's original Pascal for classrooms vs Borland's Turbo Pascal (or Free Pascal): one is designed to get stuff done with syntax and semantic features that make a lot more sense. You can use Ocaml in a style that gets you much benefits of ML. Even Coq extracts to a minimal Ocaml. Or, you can go Jane St with it developing real-world applications with excellent properties that neither SML nor C++ would have in current state. Talking like Ocaml is ML's C++ is an insult to them. C++ is garbage built on worse garbage to make the landfill smell less. You'll find plenty of C++ developers admitting they only use it because they have to for whatever reason. You don't see that with Ocaml: good design, tools, and community are driving much growth and happy developers. So, it's more "Ocaml: ML Go's Pro" rather than "C++: Bend Over, Here it Comes Again." ;)
- mercurial 11y agoI'd characterize OCaml's tools as a mixture of best-of-breed (Merlin, OPAM) and oh-my-god (build tools, debugger). The language itself, if you avert your eyes from the standard library, is pretty damn good though.
- nickpsecurity 11y agoThat matches the view others have shared with me. A few of them mentioned that Jane St re-wrote the standard library to try to fix that problem. They also gave it back to the community. Have you tried theirs? If not, take a look at it so you can tell us if you think they've gotten past that weakness. https://janestreet.github.io/ https://janestreet.github.io/
- mercurial 11y agoThere are least three competing standard libraries: Jane Street's Core (high-quality but fairly big, also generates large binaries due to OCaml's lack of good dead code elimination support), Batteries (older, developed by the community), and Containers (Simon Cruanes' project, mostly - smaller but very well-designed). They all have their advantages, the issue is that there is no one true alternative standard library, which makes the life of library writers difficult (especially when you want to use a type in your interface that is only present in one of these libraries).
- nv-vn 11y agoAs someone who writes fairly SML-ish OCaml, there definitely are benefits to using OCaml (even if only for the library and tool support... opam really is pretty awesome) over SML. I rarely end up even using the object system and other features that SML lacks, but I find the syntax a bit nicer to read and write. And unlike C++, the standard library doesn't force all the bloat you don't want to deal with on to you, so it's no big deal to write code in SML style.