3 ms·
Rather why not F#, which has all of that but with a fast compiler and is just a superset of OCaml
by JackMorgan 6y ago
Rather why not F#, which has all of that but with a fast compiler and is just a superset of OCaml
- trevyn 6y agoAnd, indeed, F#, per the followup article: https://blog.darklang.com/new-backend-fsharp/ https://blog.darklang.com/new-backend-fsharp/
- vmchale 6y agoDoesn't it have fewer features?
- cultus 6y agoIt doesn't have a real module system.
- ojnabieoot 6y ago“Fewer” is a relative term - F#’s type system is noticeably less fancy (basically generics are “weaker” than in OCaml) but having the entire .NET System library is very useful for practical programming, along with many 3rd party options. The author mentioned a lack of GCP support in OCaml as a major stumbling point, and also mentioned how nice it was that F# had a built-in immutable map. There is more to computer science than type theory - System.Collections.Concurrent is particularly cool, and hard to do in OCaml. If you know C#/Java/C++/etc some of that code is also very well-written and informative. There are use cases where OCaml’s type system leads to elegant type-safe code that, if expressed in F#, involve inelegant unsafe boilerplate. It’s usually not a whole lot and it’s typically routine but it certainly happens. For some teams and products OCaml is a better choice. But there’s also a reason why many developers abandoned Lisp for Python: some theoretical fanciness and robustness only infrequently outweighs ease-of-use and quality-of-life.