How janestreet/base works
Main Components and Structure
a. Core Library Components:
• Base Module System
• Standard Data Types
• Utility Functions
• PPX Extensions Integration
b. Supporting Components:
• Build System (Dune)
• Test Framework
• Code Generation Tools
Architectural Layers
┌─────────────────────────────────────────────────────┐
• Client Code │
• ┤
• Base Public API │
• ┤
• Core Functionality │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌───────┐ │
• Data Types│ │Containers│ │Utilities │ │PPX │ │
• ┘ └──────────┘ └──────────┘ └───────┘ │
• ┤
• Platform Abstraction │
• ┘
Component Details
• Rectangles (Blue): Core modules (String, Array, List, etc.)
• Hexagons (Green): PPX integration points
• Diamonds (Yellow): Extension points
Key Relationships to Highlight
Important relationships:
┌─────────────────┐ ┌─────────────────┐
• Base Modules │────▶│ Shadow Stdlib │
• ┘ └─────────────────┘
• ▼
┌─────────────────┐ ┌─────────────────┐
• PPX Derivers │◀───▶│ Generated Code │
• ┘ └─────────────────┘
Implementation Details
Technical aspects:
• Native code bridges (C stubs)
• PPX code generation points
• Test framework integration
• Build system integration
Notes
Important notes:
• "Stdlib replacement - no direct stdlib usage"
• "PPX generators for development only"
• "Platform-independent implementation"
• "Zero runtime dependencies"