Time library discussion (reprise)
Peter Simons
simons at cryp.to
Tue Nov 11 23:05:30 EST 2003
Simon Marlow writes:
> Presumably, without TAI support, the library will be
> unable to do accurate calendar calculations at the second
> level [...]
As I understand it, calendar time calculations into the
future are _always_ inaccurate, because UTC is not
continuous. Either you'll get an incorrect "duration" or
you'll get an incorrect "point in time". It can't be helped.
The C++ time library of the Boost effort has a very
interesting discussion of this topic, available here:
http://boost.org/libs/date_time/doc/Tradeoffs.html
Pardon me, if this has been brought up already.
As for implementing a time library in Haskell, we might be
able to base the effort on one of the existing API designs
-- or even one of the existing implementations? There are,
among others:
- The Boost.Time library mentioned above.
- A proposed API extension for the ISO C 200X standard:
http://www.cl.cam.ac.uk/~mgk25/time/c/
- Proposed ISO C 200X Calendar Library Functions:
http://david.tribble.com/text/c0xcalendar.html
- Dan Berstein's libtai: http://cr.yp.to/libtai.html
Surely there is _something_ out there that can be re-used?
Peter
More information about the Libraries
mailing list