[squeak-dev] Time primitives

David T. Lewis lewis at mail.msen.com
Tue Apr 7 21:17:11 UTC 2015


I am away and cannot double check the code right now, but the primitives
should be consistent across Cog and the interpreter VM. There had been
some confusion due to the early fork between trunk and oscog, but I
believe that Eliot and I got it sorted out quite a while ago.

These are not necessarily set up as numbered primitives, but the
implementations are there, and they can be called as named primitives in
Cog/Spur and interpreter VMs.

I don't know about the Pharo fork, it's quite possible that things have
gotten renamed there.

Note, the UTC with offset primitive is important to me because of
UTCDateAndTime (http://wiki.squeak.org/squeak/6197), which is designed
around the notion of a single primitive answering UTC time and local
offset as an atomic call to the VM.

Dave

> Hi All,
>
> CogVM has two really nice time primitives 240 and 241. These are available
> via Time class >> #primUTCMicrosecondClock and Time class >>
> #primLocalMicrosecondClock.
>
> But there are two problems with them.
> 1. They are not available in the Interpreter VM (It has a similar named
> primitive - primitiveUtcWithOffset - available as Time class >>
> #primPosixMicrosecondClockWithOffset, but that's not supported in Cog, and
> I'd like to see its behavior changed slightly*)
> 2. Primitive 240 is available in Pharo under a similar, but slightly
> different name: #primUTCMicrosecondsClock. There are also derived
> "primitive" methods: #primUTCSecondsClock and #primUTCMillisecondsClock.
>
> Questions:
> - Which name should we use?
>   - #primUTCMicrosecondClock
>   - #primUTCMicrosecondsClock
>   - something else
>
> - Can/should the interpreter VM support primitive 240 and 241?
>
> - Can/should CogVM support the name primitive primitiveUtcWithOffset?
>
> - Do we want the derived "primitives" #primUTCSecondsClock and
> #primUTCMillisecondsClock in Squeak?
>
>
> Levente
>
> * The primitive could accept an array as argument and fill that with the
> values if present. This could prevent frequent GCs when the primitive is
> used repeatedly.
>




More information about the Squeak-dev mailing list