On Feb 19, 2009, at 10:17 PM, Timothy S. Nelson wrote:
On Thu, 19 Feb 2009, Larry Wall wrote:
Well, leaving that rant aside, I'm still tempted to say that times
in Perl 6 are TAI seconds since 2000. Standard TAI would work too.
I've wondered sometimes about the idea of having a dual/moving
epoch. By this, I mean that you have eg. two Ints, one which
represents the years since 1AD or whatever, and the other of which
represents the number of seconds from the beginning of that year.
I'm sure many of you can see the advantages and disadvantages of
that scheme better than I can, but I thought I'd throw it out there
so you can all see whether or not you like it.
I don't see the advantage of either of those. TAI 2000 is just UTC
1970 plus a constant offset. 1AD is just UTC 1970 minus a bigger
constant offset. Sure, those are slightly easier epochs for a human
(ignoring the Julian/Gregorian shift), but not any easier for a
computer. UTC 1970 has the big advantage that it is already the
underlying value returned by most operating systems and many date/
time libraries, so there's no extra additive operation to perform if
that's what you want.
A much more important issue is the use of integer seconds.
Milliseconds is a much more useful precision for humans and micro- or
nanoseconds is a better precision for machines. I think Time::HiRes
with a better API as a builtin would be a big win.
Aside: I just learned the other day that Java's Thread.sleep(long
millis, int nanos) method just rounds the nanos to the nearest millis
and invokes Thread.sleep(long millis). I guess that's a forward
looking API for when the OS really can timeslice that small, but it's
a little silly today.
http://krugle.org/kse/entfiles/jdk/sun.com/jdk-1.5/j2se/src/share/
classes/java/lang/Thread.java#246
Maybe Perl 6 should be really forward looking and include a time
dilation factor so it can be the first language designed from the
ground up for interstellar travelers who want to use a non-inertial
reference. Or GPS? :-)
Chris