• en

OCaml Planet

The OCaml Planet aggregates various blogs from the OCaml community. If you would like to be added, read the Planet syndication HOWTO.

Big-step disjunctive normal forms — Matthias Puech, Apr 15, 2014

This is probably a second-semester functional programming exercise, but I found it surprisingly hard, and could not find a solution online. So at the risk of depriving a TA from a problem for its mid-term exam, here is my take on it, that I painfully put together yesterday.

Given a formula built out of conjunction, disjunction and atoms, return its disjunctive normal form, in big step or natural semantics, that is, not applying repetitively the distributivity and associativity rules, but in a si…

Read more...

Weekly News — Caml Weekly News, Apr 15, 2014

  1. index2share 0.5.72
  2. Ocsigen Js_of_ocaml 2.0
  3. Other OCaml News

OCamlPro Highlights: March 2014 — OCamlPro, Apr 15, 2014

Here is a short report of some of our activities in March 2014 !

Welcome Thomas

First, we would like to welcome Thomas Blanc on board ! Thomas is starting a PhD at OCamlPro, with Michel Mauny from ENSTA as his PhD advisor. So, he will stay with us for three years, working on static analysis of whole OCaml programs, with two main objectives:

  • To detect uncaught exceptions, using a different approach than ocamlexc, the tool that François Pessaux developed during his PhD thesis, a method that wi…

Read more...

Representing pattern-matching with GADTs — Matthias Puech, Apr 11, 2014

Here is a little programming pearl. I’ve been wanting to work on pattern-matching for a while now, and it seems like I will finally have this opportunity here at my new (academic) home, McGill.

Encoding some simply-typed languages with GADTs is now routine for a lot of OCaml programmers. You can even take (kind of) advantage of (some form of) convenient binding representation, like (weak) HOAS; you then use OCaml variables to denote your language’s variables. But what about pattern-matching?…

Read more...

Ocsigen Js_of_ocaml 2.0 — Ocsigen project, Apr 11, 2014

We are happy to announce release 2.0 of Js_of_ocaml, the compiler from OCaml bytecode to JavaScript.

A lot of efforts has been put in reducing the size of the generated JavaScript code. Much shorter variable names are used; unnecessary whitespaces and semicolons are omitted; multiple occurrences of a same constant are shared... The runtime is minified as well. You can expect a space reduction of 15% to 20%.

Recursive modules are now supported. Tail calls between mutually recursive functions …

Read more...

Inlined records in constructors — LexiFi, Apr 10, 2014

I'd like to introduce a new language feature, inlined record arguments on constructors, which I propose for inclusion in OCaml. In a nutshell, it allows you to define a record directly within a sum type constructor:

1
2
3
  type t =
     | A of { x : int; y: string }
     | ...

The argument of the constructor is a full-fledged record type. All features of records are available: dot notation, mutable fields, polymorphic fields, punning syntax, record override. You ca…

Read more...

Weekly News — Caml Weekly News, Apr  8, 2014

  1. OCaml release 5.00
  2. React 1.0.0
  3. OCaml Engineers and Scientists at CEA, Software Security Labs (Paris Saclay, France)
  4. IOCaml 0.4
  5. Second CFP: Higher-order, Typed, Inferred, Strict: ML Family Workshop
  6. Hashset implementation
  7. Core Suite 111.08.00
  8. Experiment: OCaml patch review on github.com/ocaml/ocaml
  9. Other OCaml News

Grepping the source of every OCaml package in OPAM — Anil Madhavapeddy, Apr  7, 2014

A regular question that comes up from OCaml developers is how to use OPAM as a hypothesis testing tool against the known corpus of OCaml source code. In other words: can we quickly and simply run grep over every source archive in OPAM? So that’s the topic of today’s 5 minute blog post:

git clone git://github.com/ocaml/opam-repository
cd opam-repository
opam-admin make
cd archives
for i in *.tar.gz; \
  do tar -zxOf $i | grep caml_stat_alloc_string; \
done

In this particular example we’re…

Read more...

Generic mapping and folding in OCaml — Jane Street, Apr  7, 2014

Haskell has a function fmap which can map over a number of different datatypes. For example, fmap can map a function over both a List and a Maybe (the equivalent of an option in OCaml):

Prelude> fmap (+ 1) [1,2]
[2,3]
Prelude> fmap (+ 1) (Just 3)
Just 4

Unfortunately, the equivalent is impossible in OCaml. That is, there's no way to define an OCaml value fmap so that the two expressions:

# fmap [1;2]    ~f:((+) 1)
# fmap (Some 3) ~f:((+) 1)

both typecheck and evaluate to the right value.

Read more...

Full Time: Platform Engineer at Gawker Media in New York, NY — Github OCaml jobs, Apr  3, 2014

The Gawker Media Group is the publisher of some of the web's best-loved brands and communities, including the eponymous Gawker and gadget sensation Gizmodo as well as Deadspin, Kotaku, Jalopnik, io9, Lifehacker, and Jezebel. Founded in 2002, Gawker Media now reaches nearly 110 million people around the world each month.

Never having taken outside investment, Gawker is one of the largest independently owned and operated digital media companies in the world. This year, the company releases Kinja,…

Read more...