4 ms·
Back when I tried it, there seemed to be a few verticals where Ocaml abstractions made Ocaml very productive to work with. Once a colleague and I did a program
by yafbum 3y ago
Back when I tried it, there seemed to be a few verticals where Ocaml abstractions made Ocaml very productive to work with.
Once a colleague and I did a programming race between two languages, to see how long it would take to implement a small cryptanalysis program using Ocaml vs C++. I wrote it in a day, and it took my desk neighbor who was doing the same in C++ a couple of weeks.
What made the difference:
- There were a lot of things I didn't have to worry about. For example, I was working with nontrivial structures but didn't have to write any boilerplate functions for deep equality or lex ordering.
- Immutable structures with GC made it much more direct to translate the math into a working program. Ditto with guaranteed tail recursion optimization.
- The match syntax caught many issues at compile time by forcing me to reason about every case. As a result I had many less runtime bugs to deal with, while my colleague needed to troubleshoot memory and correctness issues half the time.
Ymmv. This was for research and didn't end up in production use. The C++ implementation was also much "closer to the metal" so was able to wring out more performance. Still the difference in initial velocity was striking and there could've been a case that this would've been a better choice based on dev velocity in that vertical.