On Fri, Feb 20, 2009 at 02:07:05PM -0600, Dave Rolsky wrote:
> On Fri, 20 Feb 2009, Dave Whipp wrote:
>
>> I'm getting a bit lost following precisely what's being proposed. What 
>> I'm sort of feeling is that there are two fundamental immutable types 
>> needed: Instants and Durations:
>>
>>  multi sub infix:<-> (Instant, Instant --> Duration)
>>  multi sub infix:<+> (Instant, Duration --> Instant)
>>  multi sub infix:<-> (Instant, Duration --> Instant)
>
> Of those three, I think only the first is really required for core, so 
> you can do stopwatch type calculations.

They can all three go in core, because...

> If the Duration is just seconds, the latter two are fairly useless and  
> broken. If it's not just seconds, the math is much more complicated, and  
> that's not the sort of thing that belongs in core.

This still seems to be confusing implementation issues with the point
I'm trying to make about the basic nature of time.

Duration and Instant are both simple (but typed) Num semantics
on seconds.  There are no integers unless you specifically ask for
an interpretation in minutes, hours, fortnights, what have you.
The basic flow of time is continuous and stable in Perl 6, or as
continuous and stable as we can make it.

Hence our ideal timeline will be strict atomic time in TAI, and
machines that don't have access to the current atomic time will have
to approximate it as best they can.  They're already broken anyway,
in my opinion.

Only atomic time in atomic seconds will be futureproof over the long
haul.  All other interpretations are negotiable via libraries, but
time must be considered a position on a real timeline, and seconds
are a reasonable unit for measuring that timeline.  The method in
$duration.seconds should not have to do any calculations to return
the Num number of seconds, because whether we're talking about
gigaseconds or femtoseconds, we're still talking about seconds.

Time has no relationship to integers apart from cultural artifacts.
Let's keep our integers in the libraries, not in the fundamental
definition of what "now" and "then" mean.

Larry

Reply via email to