[Haskell-cafe] threadDelay delays less time than expected (Windows)
Richard A. O'Keefe
ok at cs.otago.ac.nz
Thu Jan 5 02:05:22 UTC 2017
On 1/01/17 10:42 PM, Yitzchak Gale wrote:
> I have heard that the Smalltalk time library got
> the semantics of time right long before even the Haskell time library,
> but I have not seen it myself in detail.
What do you mean by "the" Smalltalk library?
The classic Smalltalk-80 library included Date and Time classes
for calendar calculations and a Delay class for suspending.
The Date and Time classes were not sophisticated.
The ANSI Smalltalk standard includes a unified DateAndTime class
and a Duration class. When I tried to implement the standard
class I found it impossible, because the standard requires both
that DateAndTime be in UTC and that arithmetic work for an
unspecified range of timepoints, apparently requiring you to
predict leap seconds indefinitely far into the future. Despite
requiring UTC, it does not let you specify second=60 when
creating a timestamp. You can specify the *offset* of local
time from UTC, but implementations are allowed to impose a
limit or -12 hours to +12 hours, which excludes part of my
country. Worse, you specify an *offset*, not a *zone*, yet
an implementation is required to intuit, possibly by some form
of clairvoyance, the *zone* name relative to a time. Since
offsets do not uniquely determine zones, this is of course
impossible. Frankly, it's a mess that looks like it was
designed by someone who thought they were expert but weren't.
Of course actual Smalltalk implementations don't pay all
that much attention to the standard. Possibly "the"
Smalltalk library is the Chrono package, in which case ignore
my rant about the standard.
More information about the Haskell-Cafe