Related Articles

Articles on OCaml



Welcome to a new episode of The Flambda2 Snippets! The F2S blog posts aim at gradually introducing the world to the inner-workings of a complex piece of software engineering: The Flambda2 Optimising Compiler for OCaml, a technical marvel born from a 10 year-long effort in Research & Development and ... (Read more)



Welcome to a new episode of The Flambda2 Snippets! Today's topic is Loopify, one of Flambda2's many optimisation algorithms which specifically deals with optimising both purely tail-recursive and/or functions annotated with the [@@loop] attribute in OCaml. A lazy explanation for its utility would be... (Read more)


Authors: Louis Gesbert
Date: 2024-04-25
Category: OCaml

Uncaught exception: Not_found This blog post probably won't teach anything new to OCaml veterans; but for the others, you might be glad to learn that this very basic, yet surprisingly little-known feature of OCaml will give you backtraces with source file positions on any uncaught exception. Since i... (Read more)



Welcome to The Flambda2 Snippets! In this first post of The Flambda2 Snippets, we dive into the powerful CPS-based internal representation used within the Flambda2 optimizer, which was one of the main motivation to move on from the former Flambda optimizer. Credit goes to Andrew Kennedy's paper Comp... (Read more)


Date: 2024-03-18
Category: OCaml

Introducing our Flambda2 snippets At OCamlPro, the main ongoing task on the OCaml Compiler is to improve the high-level optimisation. This is something that we have been doing for quite some time now. Indeed, we are the authors behind the Flambda optimisation pass and today we would like to introduc... (Read more)


Date: 2023-06-27
Category: OCaml

Since 2022, OCamlPro has been contributing to GnuCOBOL, the only fully open-source compiler for the COBOL language. To speed-up our contributions to the compiler, we developed a new tool, autofonce, to be able to easily run and modify the testsuite of the compiler, originally written as a GNU Autoco... (Read more)


Date: 2023-01-02
Category: OCaml
Tags: OCaml, compiler

We recently worked on a project to build a binary installer for OCaml, inspired from RustUp for Rust. We had to build binary packages of the distribution for every OCaml version since 4.02.0, and we were surprised to discover that their (compressed) size grew from 18 MB to about 200 MB. This post gi... (Read more)


Date: 2022-12-14
Category: OCaml

In this first post about WebAssembly (Wasm) and OCaml, we introduce the work we have been doing for quite some time now, though without publicity, about our participation in the Garbage-Collection (GC) Working Group for Wasm, and two related development projects in OCaml. WebAssembly, a fast and por... (Read more)


Authors: Leo Boitel
Date: 2021-07-16
Category: OCaml
Tags: ocaml, flambda

In some discussions among OCaml developers around the empty type (PR#9459), some people mused about the possibility of annotating functions with an attribute telling the compiler that the function should be trivial, and always return a value strictly equivalent to its argument.Curious about the feas... (Read more)


Authors: Leo Boitel
Date: 2021-07-15
Category: OCaml
Tags: ocaml, flambda, fr

Au cours de discussions parmi les développeurs OCaml sur le type vide (PR#9459), certains caressaient l’idée d’annoter des fonctions avec un attribut indiquant au compilateur que la fonction devrait être triviale, et toujours renvoyer une valeur strictement équivalente à son argument. Nous ... (Read more)


Authors: Pierrick Couderc
Date: 2020-09-30
Category: OCaml
Tags: ocaml

This blog post and the previous one about functor packs covers two RFCs currently developed by OCamlPro and Jane Street. We previously introduced functor packs, a new feature adding the possiblity to compile packs as functors, allowing the user to implement functors as multiple source files or even ... (Read more)


Authors: Pierrick Couderc
Date: 2020-09-24
Category: OCaml
Tags: ocaml

OCamlPro has a long history of dedicated efforts to support the development of the OCaml compiler, through sponsorship or direct contributions from Flambda Team. An important one is the Flambda intermediate representation designed for optimizations, and in the future its next iteration Flambda 2. Th... (Read more)


Authors: Thomas Blanc
Date: 2020-03-24
Category: OCaml
Tags: best fit, fr, gc, ocaml

An in-depth Look at OCaml’s new "Best-fit" Garbage Collector Strategy Le GC d’OCaml oeuvre discrètement à l’efficacité de vos allocations mémoire. Tel un héros de l’ombre, il reste méconnu de la plupart des hackers OCaml. Avec l’arrivée d’OCaml 4.10, il s’enrichit d’une nouvel... (Read more)


Authors: Thomas Blanc
Date: 2020-03-23
Category: OCaml
Tags: ocaml, highlights, GC

An in-depth Look at OCaml’s new "Best-fit" Garbage Collector Strategy The Garbage Collector probably is OCaml’s greatest unsung hero. Its pragmatic approach allows us to allocate without much fear of efficiency loss. In a way, the fact that most OCaml hackers know little about it is a good sign:... (Read more)


Authors: Vincent Laviron
Date: 2019-09-30
Category: OCaml

Nous sommes heureux de présenter certains travaux en cours sur le compilateur OCaml, travaux menés en étroite collaboration avec notre partenaire et client Janestreet. Un travail conséquent a été fait pour aboutir à un nouveau framework d’optimisation du compilateur, appelé Flambda2, dont ... (Read more)


Authors: Thomas Blanc
Date: 2019-09-20
Category: OCaml

A look back on OCaml since 2011 As you already know if you’ve read our last blogpost, we have updated our OCaml cheat sheets starting with the language and stdlib ones. We know some of you have students to initiate in September and we wanted these sheets to be ready for the start of the school yea... (Read more)


Authors: Thomas Blanc
Date: 2019-09-14
Category: OCaml

Les mémentos (cheat-sheets) OCaml lang et OCaml stdlib partagés par OCamlPro en 2011 ont été mis à jour pour OCaml 4.08. Le langage OCaml OCaml Standard Library Si vous souhaitez contribuer des améliorations: sources sur GitHub. En savoir plus : Updated Cheat Sheets: OCaml Language and OCaml S... (Read more)


Authors: Thomas Blanc
Date: 2019-09-13
Category: OCaml

In 2011, we shared several cheat sheets for OCaml. Cheat sheets are helpful to refer to, as an overview of the documentation when you are programming, especially when you’re starting in a new language. They are meant to be printed and pinned on your wall, or to be kept in handy on a spare screen. ... (Read more)


Authors: Vincent Laviron
Date: 2019-08-30
Category: OCaml

The OCaml compiler team at OCamlPro is happy to present some of the work recently done jointly with JaneStreet's team. A lot of work has been done towards a new framework for optimizations in the compiler, called Flambda2, aiming at solving the shortcomings that became apparent in the Flambda optimi... (Read more)


Authors: chambart
Date: 2018-04-01
Category: OCaml
Tags: OCaml

This time of the year is, just like Christmas time, a time for laughs and magic... although the magic we are talking about, in the OCaml community, is not exactly nice, nor beautiful. Let's say that we are somehow akin to many religions: we know magic does exist , but that it is satanic and shouldn'... (Read more)


Authors: chambart
Date: 2017-04-01
Category: OCaml
Tags: OCaml

As you may have noticed, on the begining of April I have some urge to write something technical about some deeply specific point of OCaml. This time I'd like to tackle that through sudoku. It appeard that Sudoku is of great importance considering the number of posts explaining how to write a solver.... (Read more)


Authors: chambart
Date: 2016-04-01
Category: OCaml
Tags: OCaml

As you may know, there is a subset of Javascript that compiles efficiently to assembly used as backend of various compilers including a C compiler like emscripten. We'd like to present you in the same spirit how never to allocate in OCaml. Before starting to write anything, we must know how to find ... (Read more)


Authors: Çagdas Bozman
Date: 2014-04-01
Category: OCaml
Tags:

OCaml 4.01 with its new feature to disambiguate constructors allows to do a nice trick: a simple and generic syntax extension that allows to define your own syntax without having to write complicated parsetree transformers. We propose an implementation in the form of a ppx rewriter. it does only a s... (Read more)


Date: 2013-12-03
Category: OCaml
Tags: ocaml, tooling

New Team Members We are pleased to welcome three new members in our OCamlPro team since the beginning of November: Benjamin Canou started working at OCamlPro on the Richelieu project, an effort to bring better safety and performance to the Scilab language. He is in charge of a type inference algorit... (Read more)


Authors: Chambart
Date: 2013-07-11
Category: OCaml

As announced some time ago, I am working on a new intermediate language within the OCaml compiler to improve its inlining strategy. After some time of bug squashing, I prepared a testable version of the patchset, available either on Github (branch flambda_experiments), or through OPAM, in the follow... (Read more)


Authors: chambart
Date: 2013-05-24
Category: OCaml

Doing the compiler's work Working at OCamlPro may have some drawbacks. I spend a lot of time hacking the OCaml compiler. Hence when I write some code, I have a good glimpse of what the generated assembly will look like. This is nice when I want to write performance sensitive code, but as I usually w... (Read more)


Date: 2012-08-20
Category: OCaml
Tags: ocaml, tooling

OCaml 4.00.0 has been released on July 27, 2012. For the first time, the new OCaml includes some of the work we have been doing during the last year. In this article, I will present our main contributions, mostly funded by Jane Street and Lexifi. Binary Annotations for Advanced Development Tools OCa... (Read more)


Authors: Çagdas Bozman
Date: 2012-08-08
Category: OCaml
Tags: ocaml, tooling

We have recently worked on modifying the OCaml system to be able to profile OCaml code on Linux amd64 systems, using the processor performance counters now supported by stable kernels. This page presents this work, funded by Jane Street. The patch is provided for OCaml version 4.00.0. If you need it... (Read more)


Date: 2011-08-10
Category: OCaml
Tags: ocaml, tooling

We have recently worked on modifying the OCaml system to be able to pack a set of modules within a functor, parameterized on some signatures. This page presents this work, funded by Jane Street. All the patches on this page are provided for OCaml version 3.12.1. Packing Functors Installation of the ... (Read more)