package hermetic

All checked builds pass
  1. Overview
  2. Docs
On This Page
  1. API
Enforce Eio's capabilities at compile time

Install

dune-project
 Dependency

Authors

Maintainers

Sources

hermetic-0.1.0.tbz
sha256=3e4bcc748aaf1b4119d3f48301007e85aad489fe59952eba25f2cf915897c352
sha512=4eb66393268005675e511a3894d4ab11d39a979b48a0a90bc7b5d9d811226d9f155fb18bbd8cc2e25201e8ba0b0af5a227c161ddcfb701b229de7c764679f38f

doc/index.html

hermetic

Enforce Eio's capabilities at compile time.

Hermetic is a prelude that restates OCaml's standard library. In a file that opens it, a standard library, Unix or Thread value that reaches the file system, a clock, the network, the standard streams, entropy, a domain or a child process on its own is a type error. This covers Sys too, so Sys.remove and Sys.command are refused. Its alert names the Eio.Stdenv capability to take instead. The unsafe operations that could forge a capability, such as Obj.magic or a Marshal reader, are refused too. A source file opens the prelude on its first line:

open! Hermetic

API

  • Hermetic The standard library, restated to make code take Eio's capabilities as arguments.

Hermetic is the prelude: the standard library, Unix and Thread, with each refused value given a type nothing consumes and an alert that says why. The Hermetic__ units it aliases hold the restated modules; a program names them through Hermetic, never directly.

The library hermetic depends on the standard library only. The units of the restated Unix and UnixLabels are the library hermetic.unix, which depends on unix, and the unit of the restated Thread is hermetic.threads, which depends on threads. A library that uses Unix or Thread through the prelude names the sub-library among its libraries.