← Graph

Chrono

tool 6 connections

C++ library written by Howard Hinnant, merged into the C++ standard over four committee cycles. Separates three concerns: (1) duration — a representation plus a compile-time std::ratio to seconds (milliseconds, nanoseconds, 60 fps, NTSC frames are all just new ratio types); (2) time_point — a duration paired with a clock (system_clock, steady_clock, atomic clock, or user-defined) so a value always has a starting point; (3) calendars — entirely separate abstractions (Gregorian, Julian, ISO week, Chinese) with convenience structs for weekday/year-week/etc. Refuses auto-conversions like '31 Jan + 1 month' because the correct answer depends on domain (tax software vs Google Calendar vs scheduling). Arithmetic rules encode semantics: time_point − time_point = duration, time_point + duration = time_point, time_point + time_point = compile error. Daylight savings time is layered on top as a separate concern. All type checking happens at compile time, so generated code matches hand-rolled performant C. Wójtowicz recommends porting the ideas — not the syntax — to other languages, including Ruby.

category
library
language
C++
about
Chrono tool
Chrono is the talk's headline example of rewriting on new principles.
about
Chrono tool
Chrono is presented as the exemplary rewrite-on-new-principles.
about
Chrono tool
Chrono's refusal to answer '31 January + 1 month' is the reference design.
recommends
Chrono tool
Explicitly recommends studying Chrono and porting its ideas to Ruby.
tool Chrono
related_to
C++ tool
Chrono is a C++ standard-library component.
works_on
Chrono tool
Designed Chrono and shepherded it through four C++ committee cycles.
role: author

Provenance

Read by
3 extractions