A look back on OCaml since 2011
ocamlpro.com
ocamlpro.com
Are you the only person who has worked on it?
It was written by a teammate in 2004 (Frenchman, obviously!) and I’ve owned it since. A number of people have submitted features, etc. It’s fairly straightforward and OCaml wasn’t really a barrier to entry for any of the contributors.
edit: I should have said “source changes due to OCaml upgrades” above to be more clear.
what's the state of this nowadays?
> better Windows support
couldn't agree more - they can learn on Go's lessons (the language didn't get much traction until they added Windows support).
> use algebraic effects to compose concurrency and supports parallelism through domains and incremental GC. Rather than adding a specific multicore scheduler into the runtime system, we’re providing the minimum required toolset in the form of pluggable schedulers.
Care to elaborate?
Sure, but at the end of the day what it means is 5 years into the effort OCaml still as limited threading-wise as it was at the start of the effort. And that is what most users (and non-users) care about in a world where 2/4 is your mobile baseline and where AMD's R3-3300G is expected to be 6/12 for $99.
4.10 will also include a recently merged, large change for multicore support: https://github.com/ocaml/ocaml/pull/8713
The plan is to land multicore in trunk through a series of smaller chunks such as #8713
Ocaml multicore has been on the tablet since ... pretty much the dawn of time. It's save to call it vaporware or the duke nukem forever of Ocaml.
It's something of a lost art in the paperless and HTML era of documentation.
https://arxiv.org/pdf/1512.01895.pdf
https://old.reddit.com/r/ocaml/comments/4qan0w/modular_type_...
The module system is used when a type must support certain operations. For example, the Set module (https://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.html) defines a signature called OrderedType for types equipped with a comparison function, and any module that implements OrderedType can be used to make a set.
Notably, ML modules differ from Haskell typeclasses because more than one module can exist for the same combination of types. However, you must pass ML modules explicitly, whereas typeclass instances are passed implicitly. So, ML modules have more power than typeclasses, but at the cost of convenience.
Here is an example where modules are used to make a set:
module LtInt = struct
type t = int
(* Use built-in polymorphic comparison *)
let compare = compare
end
module GtInt = struct
type t = int
let compare lhs rhs = compare rhs lhs
end
module LtIntSet = Set.Make(LtInt)
module GtIntSet = Set.Make(GtInt)
However, modules can quickly get inconvenient: module type Monoid = sig
type t
val op : t -> t -> t
val e : t
end
module Addition = struct
type t = int
let op = (+)
let e = 0
end
module Multiplication = struct
type t = int
let op = ( * )
let e = 1
end
module FoldLeft (M : Monoid) = struct
let fold_left = List.fold_left M.op M.e
end
Here, it's probably less verbose to just pass the operation and starting value directly to List.fold_left than to use modules! Debatably, this is as equally inconvenient as Haskell's newtype solution to multiple instances, but if there is only one instance, typeclasses are much cleaner to use.Modular implicits are a long-awaited feature that will allow ML modules to be passed implicitly.
https://www.cl.cam.ac.uk/~jdy22/papers/modular-implicits.pdf
Sadly, meanwhile "Standard" ML is languishing in academia...