News for hackers. Stuff that matters.
Re:Draft of OCaml Scientific Computing book by brmgb on Wednesday August 26, 2020 @10:04AM (#24282573)
> It's harder to do generic polymorphism in OCaml since the language has nothing like C++'s parametric templates or Haskell's type classes. It does have a very nice module system that has the required flexibility, but compared to these languages, I think it is clunky for the kind of genericity seen in scientific computing.

Are parametrized modules really clunkier than parametric templates ?

Re:Draft of OCaml Scientific Computing book by steev on Wednesday August 26, 2020 @10:21AM (#24282710)
At least for beginners, they absolutely are. I have found undergrads generally get the idea behind something like HashMap<Integer, String> but getting them to reason about OCaml modules takes quite a bit of effort.
Re:Draft of OCaml Scientific Computing book by gopiandcode on Thursday August 27, 2020 @10:28AM (#24294019)
(int, string) Map.t doesn't seem to be too many steps away from your example. When I was learning OCaml, I found that much of the module and module type system can just be seen as a more beefed up version of interfaces in OOP languages, so it didn't take long to see its benefits.