L4 Core Libraries

L4 ships with a set of core libraries that provide essential functions for common tasks. These libraries are written in L4 itself and serve as both utilities and examples of idiomatic L4 code.

Overview

Core libraries are located in the jl4-core/libraries/ directory:

  • prelude - Standard functions (automatically imported)
  • daydate - Date calculations and temporal logic
  • time - Wall-clock time-of-day operations
  • datetime - Absolute points in time with timezones
  • timezone - IANA timezone constants
  • excel-date - Excel date compatibility
  • math - Mathematical functions
  • currency - Currency handling (ISO 4217)
  • legal-persons - Legal entity types and capacity
  • jurisdiction - Jurisdiction definitions
  • holdings - Holdings and ownership
  • actus - ACTUS financial contract types and evaluation
  • date-compat - Legacy DATE syntax compatibility
  • llm - LLM API integration

Using Libraries

Libraries require explicit import:

IMPORT daydate
IMPORT math
IMPORT currency

Import Paths

Import by library name or file path:

IMPORT daydate                   -- Standard/core library
IMPORT "my-custom-lib.l4"        -- Custom library

See Also