camels
Showing 1–2 of 2 transcripts.
- Jane Street9 min
How to Use OCaml's Coercion Operator
This session explores standard OCaml's subtyping and coercion mechanisms, emphasizing how the `:>` operator enables compile-time type checks without runtime overhead or data reallocation. The discussion details value inclusion principles for polymorphic variants, recursive subtyping relations, and the specific constraints imposed by private type abbreviations to enforce invariants. While confirming that list coercions remain free at runtime, the presentation notes upcoming analysis of variant annotations and object types in future sessions.
- Jane Street9 min
Introducing the OCaml Local Mode | OCaml Unboxed
Jane Street is refining the OCaml compiler's type system to introduce a "local mode" feature that enforces function parameters to remain within their execution scope, thereby preventing value escaping. This mechanism guarantees the isolation of mutations and facilitates safer resource management in callback patterns by ensuring local arguments cannot be stored or returned. While the feature remains experimental within the Jane Street branch, it aims to optimize allocation behavior for latency-sensitive code before potential upstream integration.