Objective Caml release 3.12.0: first-class modules, explicit generic types, polymorphic recursion, local module opening, richer module language...
groups.google.com/group/fa.caml/browse_thread...Posted Aug 2, 2010, 2:20 PM UTC
Posted Aug 2, 2010, 2:20 PM UTC
Xavier Leroy's OCaml Users Group talk [warning: PDF] actually discusses the new language features in a rather more useful way. Skip to about half way through the slides.
I don't think any of them are especially earth-shattering, but they make a language which is already rather good, just that little bit nicer.
Now to get on with Fedora packaging ...
Thanks for the link, that is more helpful than the release notes.
Wow! Lots of awesome new features in OCaml 3.12. If I'm understanding correctly, you can now do non-regularly recursive data structures like in chapter 10 of Purely Functional Data Structures by Chris Okasaki. That means simple implementations of efficient data structures like binary random-access lists and tries.
It was already possible via a number of techniques (sorry for the self-post, but it's exhaustive. Be sure to read the comments). Now we get to drop all the cruft.
This release turned out to have far more new features than I was expecting. The first-class modules in particular seem ripe for mind-blowing hackery. Can't wait!
Another example, polymorphizing monomorphic data structures:
let nub_by (type s) (eq : s -> s -> bool) (xs : s list) =
let module H =
Hashtbl.Make(struct type t = s let equal = eq let hash = Hashtbl.hash end) in
let h = H.create 11 in
H.(List.fold_right (fun x ys -> if mem h x then ys else (add h x (); x :: ys)) xs [])
Edit: Syntax errors.
Explicit dictionary passing got a bit more palatable. I didn't check this, so take it with a large grain of salt:
module type MONAD = sig type 'a t ... end
let fmap (module M : MONAD) (f : 'a -> 'b) m =
M.(m >>= fun x -> return (f x))
I'm probably going to be downvoted, but this made me chuckle:
Latest meeting of the Consortium Well attended: 12 participants + 4 INRIA.
Don't confuse the OCaml Consortium (paying members from the industry: CEA, Citrix, Dassault Aviation, Dassault Systèmes, Intel, Jane Street Capital, LexiFi, Microsoft, MLstate, OCamlCore and SimCorp) with the OCaml Meeting, a community event whose attendance is limited to 80-100 people for logistical reasons.
[deleted]
I just compiled the source but it seems to be missing ocamlopt and omake. Should I be concerned?
OMake is a separate piece of software. For ocamlopt, you may not have done make opt? (alternatively, make world.opt).
I found a binary package and that had everything.
can somebody provide a msys-based build with working OpenGL >= 2 and SDL?
[deleted]
While those features are certainly useful for large-scale programing I think it was a particulary short-sighted decision years back, the the OCaml implementation by INRIA will not change to support parallelism à la GHC.
Yawn, I'll say it again. There's a multicore implementation. The benefits are very unclear, and the downsides are great complexity. Discussed at the users conference, and users don't want this complexity for such a poor programming model and unclear benefits.
I stand corrected.While I was aware of of that SoC, I thought this effort was stopped after JSC stopped supporting it and never managed to discover that page. Thank you.
[deleted]
And no one gives a shit.
As a matter of fact I do. Thank you for your contribution.
Why the fuck do trolls like you even reply? Don't you have some crappy php code to write? (Not implying all php is crap. Just the php written by kiddies with that sort of attitude.)
No, all PHP code is crap, even that written by good developers. It's not their fault, of course. PHP itself is so horribly fucking broken that even the best developers in the world can't twist it into something usable.
Why the fuck do trolls like you even reply?
I need to eat.
Also, not mentioned in the Changelog, the module language now supports
module type of [module expression], as in (dummy example)or
In particular, this means the compiler can generate automatically a module type matching an existing top-level module.