CAMLroot: revisiting the OCaml FFI

12/12/2018
by   Frédéric Bour, et al.
0

The OCaml language comes with a facility for interfacing with C code -- the Foreign Function Interface or FFI. The primitives for working with the OCaml runtime -- and, in particular, with the garbage collector (GC) -- strive for a minimal overhead: they avoid unnecessary work and allow for calls to C code to be very cheap. But they are also hard to use properly. Satisfying the GC invariants leads to counter-intuitive C code and there are hardly any safety checks to warn the developer. In this work, we explore two complementary approaches to mitigate these issues. First, simply adding an indirection to the API manipulating OCaml values let us write safer code amenable to optional runtime tests that assert proper use of the API. Second, a notion of region for tracking lifetimes of OCaml values on C side let us trade some performance for simpler code.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/18/2019

API Misuse Correction: A Statistical Approach

Modern software development relies heavily on Application Programming In...
research
07/17/2023

In-IDE Generation-based Information Support with a Large Language Model

Understanding code is challenging, especially when working in new and co...
research
02/16/2022

Code Generation for Unknown Libraries via Reading API Documentations

Open-domain code generation is a challenging problem because the set of ...
research
12/01/2020

Designing Voice-Controllable APIs

The main purpose of a voice command system is to process a sentence in n...
research
12/31/2021

OWLOOP: A Modular API to Describe OWL Axioms in OOP Objects Hierarchies

OWLOOP is an Application Programming Interface (API) for using the Ontol...
research
07/02/2018

BesFS: Mechanized Proof of an Iago-Safe Filesystem for Enclaves

New trusted computing primitives such as Intel SGX have shown the feasib...
research
01/19/2021

Anticoncentration versus the number of subset sums

Let w⃗ = (w_1,…, w_n) ∈ℝ^n. We show that for any n^-2≤ϵ≤ 1, if #{ξ⃗...

Please sign up or login with your details

Forgot password? Click here to reset