Why Core?

A standard library, with batteries included

Core_kernel, the system-independent part of Core, is a souped-up and filled-out version of Base, Jane Street’s minimal standard library replacement. Some Core_kernel modules are mere extensions of their counterparts in Base, usually adding generic functionality by including functors that make them binable, comparable, sexpable, blitable, etc.

The bulk of Core_kernel, though, is modules providing entirely new functionality. Some highlights:

Full Unix support

Core_kernel is the portable subset of Core that avoids Unixisms, as well as things like threads that don’t match well with the Javascript and Mirage back-ends. Core, though, embraces Unix and adds modules for working with the system, for instance:

  • A set of modules for dealing with times of various precisions, and time zones, on various architectures and environments

  • Command, a library for purely functional command line processing

  • Daemon, for daemonizing processes

  • Signal, for working with Unix signals

  • Process_env, utility functions for dealing with the environment

  • Schedule, which defines a type for schedules like “every 5 min after the hour” or “every weekday at 3pm”

  • Squeue, a thread-safe queue module with locks

Getting started

Installation

$ opam install core

Usage

open Core

API Documentation

See here for complete API docs.

Where Core fits in

Jane Street has three standard library packages that offer varying levels of completeness and stability. Here’s how they fit together:

Base

Minimal stdlib replacement. Portable and lightweight and intended to be highly stable. See the page for Base.

Core_kernel

Extension of Base. More fully featured, with more code and dependencies, and APIs that evolve more quickly. Portable, and works on Javascript. Core_kernel’s API Docs

Core

Core_kernel extended with UNIX APIs.