Time as Intervals: A New Perspective with Elixir's Tempo Library

165
clicks
Time as Intervals: A New Perspective with Elixir's Tempo Library

Source: youtube.com

Type: Video

In his ElixirConf 2022 talk, Kip Cole argues that traditional representations of time in computing languages are overly complex. He notes the separation of types for dates, times, and date-times in Elixir and questions why we can specify '11 am' without a day but not 'November' without a full date. Kip suggests that thinking about time as intervals, not moments, can help express dates and times more naturally and lead to less error-prone constructs. His solution is the Tempo library, which offers unified handling of time based on intervals, supporting the expression of dates, times, and date-times in a cohesive way. This allows for enumeration, repeating patterns, and time algebra. The Tempo library follows ISO 8601 syntax and enables new capabilities, such as accounting for variable-length time units like months and leap years.

© HashMerge 2024