A Non-allocating Optionin-person
This program is tentative and subject to change.
We strongly typed functional programmers pride ourselves on writing robust code, making error conditions explicit through expressive types such as option
and result
. Yet, of course, we also want our code to run fast. These desires – explicit, statically checked error conditions – and performance are sometimes in contention: every function that wants to return a result of type answer option
must use the Some
constructor to build successful results. This causes runtime allocation, which eventually triggers latency-causing garbage collection.
This talk describes the design and implementation challenges of taking advantage of an all-0, or null, value to denote error conditions, all without losing the strongly typed nature of option
. Our new optional type is named or_null
, with constructors This
and Null
. The key step is to distinguish with-null types from no-null types, as explained in this extended abstract. We have a prototype implementation in a branch of the OCaml compiler.
Paper (ocaml2024-paper16.pdf) | 402KiB |
Software Engineer at Jane Street. I believe that clever application of theory can eliminate a great deal of programmer errors – specifically, I think fancy types and functional programming are the future. I completed my PhD in 2016 at University of Pennsylvania working under Stephanie Weirich; my dissertation topic was the integration of dependent types into the Haskell programming language. I am a core contributor to the Glasgow Haskell Compiler (GHC) and Chair of the Board of Directors at the Haskell Foundation. My current work at Jane Street centers around further development of the OCaml language and compiler.
This program is tentative and subject to change.
Sat 7 SepDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
09:00 - 10:30 | |||
09:00 22mTalk | On the design and implementation of Modular Explicits OCaml Pre-print File Attached | ||
09:22 22mTalk | Flambda2 Validator OCaml Pre-print File Attached | ||
09:45 22mTalk | A Non-allocating Optionin-person OCaml Richard A. Eisenberg Jane Street Pre-print File Attached | ||
10:07 22mTalk | Mixed Blocks: Storing More Fields Flatin-person OCaml Nicholas Roberts Jane Street Pre-print File Attached |