Re: [Scheme-reports] current-posix-second is a disastrous mistake
Ray Dillinger 14 Dec 2010 09:40 UTC
On Mon, 2010-12-13 at 21:33 -0800, Alex Shinn wrote:
> On Thu, Dec 9, 2010 at 7:28 PM, Taylor R Campbell
> <campbell+scheme@mumble.net> wrote:
> > At <http://trac.sacrideo.us/wg/wiki/TimeCowan> is a proposal for a
> > procedure called CURRENT-POSIX-SECOND that returns the number of
> > seconds that have elapsed since 1970-01-01T00:00:00Z[*], *minus* the
> > number of those seconds that were leap seconds in UTC. In the terms
> > of POSIX, it returns the current POSIX time.
> >
> > This is a disastrous mistake.
>
> I've looked into this, and I must say I concur wholeheartedly. I have
> no idea what the committee was thinking when they came up with
> POSIX time, but I can only assume they were under the influence of
> some substance for which the idea of time passing at varying speeds
> seems natural.
The POSIX second is a calendrical second. It is good for measuring or
specifying intervals in days and fractions-of-days, bad for measuring or
specifying intervals in SI seconds. We define all our "common" units
(hours, minutes, calendrical years, common seconds, etc) in terms of
days. But days are not a constant-length unit. we've defined a more
precise standard for the SI second, and as a result the SI or "exact"
second count doesn't correspond exactly to the count of calendrical
days.
These two types of measuremet are fundamentally different ideas, and,
IMO, need different interfaces.
For clarity I would consider them to need different units as well;
people who want calendrical operations are thinking in terms of days and
fractions of days, so things dealing with calendrical time (the base
unit of which is the POSIX second on most systems) should be denominated
in the real number of days since some epoch. People dealing with
timings and exact intervals (the base unit of which is the SI
second) should be denominated in SI seconds since some epoch.
So someone who wants to submit a trading order the second after the
market opens on the day after his stock options mature needs to
specify the instant using days, not all of which are the same
length. Someone who wants to know how long an annealing process
takes, needs to use SI seconds.
Bear
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports