[squeak-dev] UTCDateAndTime updated for Squeak trunk Chronology and Spur (was: UTCDateAndTime updated for Squeak 4.6/5.0)

Bert Freudenberg bert at freudenbergs.de
Tue Mar 15 09:02:20 UTC 2016


If we have to touch the VM for this anyway, is there any reason not to use the Smalltalk epoch for this primitive, as Eliot suggested? This would put it in line with the other primitives (and make it slightly cheaper to use the skewed VM time).

- Bert -

> On 15.03.2016, at 02:50, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> Urk. Sorry for the confusion, but I was looking at the wrong image and I see
> now that my original statement was correct:
> 
>   "I had the same idea, and I already implemented it in trunk interpreter
>   VMMaker, but it is probably not in oscog yet. I did not add it on the
>   image side, although we could do so if we update the VMs."
> 
> This is in the trunk VMM (interpreter VM), though not in Cog/Spur yet. Better
> yet, it already works with Levente's idea (see below) of passing the DateAndTime
> instance to the primitive. No further changes to the primitive are needed to
> do this.
> 
> Therefore the following works in a Squeak 4.6 image with UTCDateAndTime loaded,
> and running on an interpreter VM:
> 
>  DateAndTime>>initializeFromPrimitive
> 	^Time primPosixMicrosecondClockWithOffset: self
> 
>  DateAndTime basicNew initializeFromPrimitive ==> 2016-03-14T21:38:49.81355-04:00
> 
> So I think this is a very good idea that just needs a couple of minor VM
> updates to make it available.
> 
> Dave
> 
> 
> On Sun, Mar 13, 2016 at 03:03:55PM -0400, David T. Lewis wrote:
>> Apologies, this is not right. I was replying from a cell phone and my
>> recollection was wrong.
>> 
>> I did at one point implement a #primitiveUtcWithOffset that could receive
>> an array of size two as an argument into which the result values are stored,
>> instead if allocating the array in the primitive. However, I did *not* commit
>> it to VMMaker, and it is not in any currently available VMs.
>> 
>> I think I decided at the time that this approach was dangerous because it
>> would invite problems in cases involving multiple processes, where some
>> other process might call the primitive using the same array. In that case
>> the time value in the array would magically change without the first process
>> being aware.
>> 
>> I still think that it is a good idea, but maybe not worth the risk unless
>> there is a noticable affect of performance or GC activity. Of course, adding
>> the capability to the primitive would not force anyone to actually use it
>> that way.
>> 
>> Sorry for the misinformation.
>> 
>> Dave
>> 
>> 
>> On Sat, Mar 12, 2016 at 11:37:55PM -0500, David T. Lewis wrote:
>>> I had the same idea, and I already implemented it in trunk interpreter
>>> VMMaker, but it is probably not in oscog yet. I did not add it on the
>>> image side, although we could do so if we update the VMs.
>>> 
>>> Dave
>>> 
>>>> I always forget to mention, even though I have had this idea since you had
>>>> introduced primitiveUtcWithOffset, that it would be better if the
>>>> primitive could take an optional argument to store the values in the first
>>>> two slots of it instead of creating a new Array. If it's too much burden
>>>> to accept any object, then the argument type can be limited to Array.
>>>> This change would make it possible to decrease the GC pressure when many
>>>> timestamps are created in a row.
>>>> 
>>>> Levente
>>>> 
>>>> On Sat, 12 Mar 2016, David T. Lewis wrote:
>>>> 
>>>>> On Mon, Mar 07, 2016 at 12:21:38AM -0500, David T. Lewis wrote:
>>>>>> On Sun, May 24, 2015 at 12:36:02PM -0400, David T. Lewis wrote:
>>>>>>> UTCDateAndTime is a UTC based implementation of class DateAndTime with
>>>>>>> one instance variable representing the magnitude of the point in time,
>>>>>>> and another representing local time zone offset.
>>>>>> 
>>>>>> I have updated the UTCDateAndTime package to make it loadable in the
>>>>>> latest
>>>>>> Squeak trunk and Spur.
>>>>> 
>>>>> Has anyone looked at this yet? Any interest?
>>>>> 
>>>>> Dave
>>>>> 
>>>>>> 
>>>>>> A new Monticello repository is at
>>>>>> http://www.squeaksource.com/UTCDateAndTime.
>>>>>> The home page (with a new SAR) is at
>>>>>> http://wiki.squeak.org/squeak/6197.
>>>>>> 
>>>>>> Starting with an updated trunk image, you can load UTCDateAndTime in
>>>>>> two ways:
>>>>>> 
>>>>>> 1) Open the http://www.squeaksource.com/UTCDateAndTime repository, and
>>>>>> load
>>>>>> the MCZ files in sequence beginning with Chronology-Core-dtl.3.
>>>>>> 
>>>>>> 2) In a preferences browser, in category 'updates' set the 'Update URL'
>>>>>> preference to 'http://www.squeaksource.com/UTCDateAndTime', and do
>>>>>> world -> help... -> update code from server.
>>>>>> 
>>>>>> The main objective of UTCDateAndTime is to make DateAndTime
>>>>>> conceptually
>>>>>> simpler, but a happy side effect is that it is also significantly
>>>>>> faster
>>>>>> than the old implementation.
>>>>>> 
>>>>>> Dave
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4207 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160315/4d57dcf2/smime.bin


More information about the Squeak-dev mailing list