Skip to main content

Crate bhc_session

Crate bhc_session 

Source
Expand description

Compiler session state, options, and configuration for BHC.

This crate provides the central session management for the BHC compiler, including compilation options, diagnostic configuration, and global state that persists throughout a compilation unit.

§Overview

The Session type is the primary entry point, holding all state needed for a single compilation. It includes:

  • Compiler options and flags
  • Target specification
  • Diagnostic handler
  • Search paths for modules and libraries

§Profiles

BHC supports multiple compilation profiles as specified in H26-SPEC:

  • Default: Standard lazy Haskell semantics
  • Server: Optimized for concurrent server workloads
  • Numeric: Strict-by-default with fusion guarantees
  • Edge: Minimal runtime for embedded/WASM targets

Structs§

IrDumpOptions
Options for dumping intermediate representations.
Options
Compiler options that can be set via CLI or configuration.
SearchPaths
Search path configuration for finding modules and libraries.
Session
The compiler session holds all state for a compilation unit.

Enums§

DebugInfo
Debug information level.
OptLevel
Optimization level for code generation.
OutputType
Output type for compilation.
Profile
The compilation profile determines evaluation semantics and optimization strategy.
SessionError
Errors that can occur during session operations.

Functions§

create_session
Create a shared session reference.

Type Aliases§

SessionRef
A shared, thread-safe reference to a session.