OCaml

Rehabilitating packs using functors and recursivity, part 2.

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 parameterized libraries. In this blog post, we Rehabilitating packs using functors and recursivity, part 2.

Tags: , ,

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: you want a runtime to gracefully do its job without having to mind it all the An in-depth Look at OCaml’s new “Best-fit” Garbage Collector Strategy

Tags: , ,

New version of TryOCaml in beta!

We are happy to announce that our venerable “TryOCaml” service is being retired and replaced by a new, modern version based upon our work on Learn-OCaml. → Try it here ← The new interface provides an editor panel besides the familiar top-level, error and warning positions highlighting, the latest OCaml release (4.10.0), local storage of New version of TryOCaml in beta!

Tags: ,

2019 at OCamlPro

OCamlPro was created to help OCaml and formal methods spread into the industry. We grew from 1 to 21 engineers, still strongly sharing this ambitious goal! The year 2019 at OCamlPro was very lively, with fantastic accomplishments all along! Let’s quickly review the past years’ works, first in the world of OCaml (flambda2 & compiler optimisations, 2019 at OCamlPro

Tags: , , , , , , , , , ,

Reduced Memory Allocations with ocp-memprof

In this blog post, we explain how ocp-memprof helped us identify a piece of code in Alt-Ergo that needed to be improved. Simply put, a function that merges two maps was performing a lot of unnecessary allocations, negatively impacting the garbage collector’s activity. A simple patch allowed us to prevent these allocations, and thus speed Reduced Memory Allocations with ocp-memprof

Tags: , , , , , , ,

Yes, ocp-memprof (s)can(f) !

A few months ago, a memory leak in the Scanf.fscanf function of OCaml’s standard library has been reported on the OCaml mailing list. The following “minimal” example reproduces this misbehavior: [code language=”fsharp” title=”(* in file scanf_leak.ml *)”] for i = 0 to 100_000 do let ic = open_in "some_file.txt" in Scanf.fscanf ic "%s" (fun _s Yes, ocp-memprof (s)can(f) !

Tags: , , , , , ,

Cumulus and ocp-memprof, a love story

In this blog post, we went on the hunt of memory leaks in Cumulus by using our memory profiler: ocp-memprof. Cumulus is a feed aggregator based on Eliom, a framework for programming web sites and client/server web applications, part of the Ocsigen Project. First, run and get the memory snapshots To test and run the Cumulus and ocp-memprof, a love story

Tags: , , , , , , ,

The Generic Syntax Extension

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 simple transformation: replace strings prefixed The Generic Syntax Extension

Tags: , ,

Better Inlining: Progress Report

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 following repository: [code language=”bash” gutter=”false”] opam repo add Better Inlining: Progress Report

Tags: , , ,

An Indentation Engine for OCaml

Since our last activity report we have released the first stable versions of two projects: OPAM, an installation manager for OCaml source packages, and ocp-indent, an indentation tool. We have already described the basics of OPAM in two precedent blog posts, so today we will focus on the release of ocp-indent. Indentation should be consistent An Indentation Engine for OCaml

Tags: , , ,

Beta-release of OPAM

OPAM is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow. I have recently announced the beta-release of OPAM on the caml-list, and this blog post introduces the basics to new OPAM users. Why OPAM We have decided to start writing a brand new Beta-release of OPAM

Tags: , ,

OCamlPro’s Contributions to OCaml 4.00.0

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 OCaml 4.00.0 has a OCamlPro’s Contributions to OCaml 4.00.0

Tags: , ,

Profiling OCaml amd64 code under Linux

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 for 3.12.1, some more Profiling OCaml amd64 code under Linux

Tags: , ,

Packing and Functors

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 modified OCaml system The Packing and Functors

Tags: , , , ,

OCaml and Windows

Recently, I have been experimenting wiht OCaml / MSVC running on Windows 7 64bit. I have mainly followed what the OCaml’s README.win32 was saying and I learned some NSIS tricks. The result of this experiment is the following two (rather big) windows binaries : ocaml-trunk-64-installer.exe (92 MB) ocaml-3.12-64-installer.exe (92 MB) These binaries are auto-installer for OCaml and Windows

Tags: , ,

OCaml Cheat Sheets

When you are beginning in a new programming language, it is sometimes helpful to have an overview of the documentation, that you can pin on your wall and easily have a look at it while you are programming. Since we couldn’t find such Cheat Sheets, we decided to start writting our own cheat sheets for OCaml Cheat Sheets

Tags: , ,

OCaml 32bits longval

Archive: ocaml-3.11.2-longval-byte-i686.tar.bz2 You will need OCaml 3.11.2 installed on a i686 linux computer. The archive contains: libcamlrun-linux-i686.a ocamlrun-linux-i686 Makefile README The Makefile has two targets: sudo make install will save /usr/bin/ocamlrun and /usr/lib/ocaml/libcamlrun.a in the current directory and replace them with the longval binaries. sudo make restore will restore the saved files. If your install OCaml 32bits longval

Tags: , ,