How hyperjeff/physical works
Main Components
a. Core System Layer:
• Physical Type System
• Unit Conversion Engine
• Dimensional Analysis System
• Numeric Operations Handler
b. Generated Components:
• Unit Definitions
• Conversion Types
• Floating Point Units
c. Experimental Features:
• Constants System
• Statistical Operations
• Array Operations
• Special Functions (dB calculations)
┌─────────────────────────────────────────────────┐
• Client Code │
• ┘
• ↓
┌─────────────────────────────────────────────────┐
• Public API Layer │
• Unit Extensions (.meters, .kelvin, etc.) │
• Operator Overloads │
• Conversion Functions │
• ┘
• ↓
┌─────────────────────────────────────────────────┐
• Core System Layer │
• ┬─────────────────┬────────────────┤
• Physical │ Dimensional │ Unit │
• Value Type │ Analysis │ Conversion │
• ┴─────────────────┴────────────────┘
• ↓
┌─────────────────────────────────────────────────┐
• Generated Components │
• PhysicalUnits │
• FloatingPointUnits │
• PhysicalConversionType │
• ┘
• ↓
┌─────────────────────────────────────────────────┐
• Experimental Features │
• Constants │
• Array Operations │
• Statistics │
• Special Functions (dB) │
• ┘
Important Relationships
a. Data Flow:
• How unit conversions flow through the system
• How dimensional analysis validates operations
• Demonstrate type checking paths
b. Dependencies:
• Connection to Foundation's Measurement framework
• Relationship between core types and generated code
• Integration of experimental features
Implementation Details to Highlight
• How the Physical type composes with various units
• Where type checking occurs (runtime vs. compile-time)
• Demonstrate error handling paths (NotAThing propagation)
• Precision tracking flow
Notes for Implementation
• Keep the core Physical type system central
• Extensibility points
• Clear boundaries between generated and hand-written code
• Where experimental features can be opted into
Remember to include notes about the framework's unique features like automatic precision tracking, dimensional analysis, and the special handling of temperature and angle calculations.