Ancient Mantis Report - 1650 PrimitiveScanCharacters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Ancient Mantis Report - 1650 PrimitiveScanCharacters

timrowledge
Clearing out old bug reports can be very alarming. Take this one -
http://bugs.squeak.org/view.php?id=1650

Between 3.7 & 3.8 the shape of CharacterScanner was changed in such a way that the scan characters primitive (much beloved by us ancient and gray vm hackers) cold not work. That's what, 9 years ago?

I'm not sure what the best 'fix' is. Fix the prim? Fix the image? Drop the prim entirely from the current images?

But really - changing  a core vm-known class so the vm doesn't know it any more? Ouch. Bad programmer. Sit in the naughty corner!

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Has an inferiority complex, but not a very good one.



Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

Nicolas Cellier
Clearly, character scanning inner loop is now written all in Smalltalk, and that seems efficient enough on our computers.
Is it a problem on Pi?
IMHO, the thing to do would be to document the primitive as backward compatibility support only (interpreter VM)
In case of COG, since there is no such backward compatibility anyway, drop the primitives.
Or rewrite them to support i18n...


2013/7/21 tim Rowledge <[hidden email]>
Clearing out old bug reports can be very alarming. Take this one -
http://bugs.squeak.org/view.php?id=1650

Between 3.7 & 3.8 the shape of CharacterScanner was changed in such a way that the scan characters primitive (much beloved by us ancient and gray vm hackers) cold not work. That's what, 9 years ago?

I'm not sure what the best 'fix' is. Fix the prim? Fix the image? Drop the prim entirely from the current images?

But really - changing  a core vm-known class so the vm doesn't know it any more? Ouch. Bad programmer. Sit in the naughty corner!

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Has an inferiority complex, but not a very good one.






Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

timrowledge

On 21-07-2013, at 12:02 PM, Nicolas Cellier <[hidden email]> wrote:

> Clearly, character scanning inner loop is now written all in Smalltalk, and that seems efficient enough on our computers.

Well, when is efficient enough, enough? The first problem is that for every send to basicScanCharacters… we are wasting time on calling the prim and failing it after pointless work. Second is that we have no measurement for whether things would be faster with the prim working or not. I could easily believe that on a Cog vm it would be about the same either way, but only after seeing decent tests results.

> Is it a problem on Pi?

Performance wise, almost everything to do with running under Morphic is a problem. Run in an MVC project on a Pi and see it fly!

> IMHO, the thing to do would be to document the primitive as backward compatibility support only (interpreter VM)
> In case of COG, since there is no such backward compatibility anyway, drop the primitives.
> Or rewrite them to support i18n…

I'd love to se some reasonable tests done to measure the effect of
a) remove prim entirely
b) fix prim (probably by actually faking up a test scanner class that doesn't break the prim rules)
c)  machine differences -pc, mac, plain interp, cog, Pi, Pi stackvm


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Try not to let implementation details sneak into design documents.



Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

Nicolas Cellier
Ah yes, you're right, why calling this primitive at all?
Note that I also changed stopConditions because 257-1 and 258-1 are valid Character codes
(A macron see for example http://tech.groups.yahoo.com/group/squeak/message/118800)
So the primitive just has one less chance to work.
Anyway, would the primitive do kerning?

Maybe the primitive can still be useful for a simplified image like Cuis though (no internationalization). Did you take a look?
In which case we'd better not remove it from COG.


2013/7/22 tim Rowledge <[hidden email]>

On 21-07-2013, at 12:02 PM, Nicolas Cellier <[hidden email]> wrote:

> Clearly, character scanning inner loop is now written all in Smalltalk, and that seems efficient enough on our computers.

Well, when is efficient enough, enough? The first problem is that for every send to basicScanCharacters… we are wasting time on calling the prim and failing it after pointless work. Second is that we have no measurement for whether things would be faster with the prim working or not. I could easily believe that on a Cog vm it would be about the same either way, but only after seeing decent tests results.

> Is it a problem on Pi?

Performance wise, almost everything to do with running under Morphic is a problem. Run in an MVC project on a Pi and see it fly!

> IMHO, the thing to do would be to document the primitive as backward compatibility support only (interpreter VM)
> In case of COG, since there is no such backward compatibility anyway, drop the primitives.
> Or rewrite them to support i18n…

I'd love to se some reasonable tests done to measure the effect of
a) remove prim entirely
b) fix prim (probably by actually faking up a test scanner class that doesn't break the prim rules)
c)  machine differences -pc, mac, plain interp, cog, Pi, Pi stackvm
Try not to let implementation details sneak into design documents.






Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

J. Vuletich (mail lists)
In reply to this post by Nicolas Cellier

Quoting Nicolas Cellier <[hidden email]>:

Clearly, character scanning inner loop is now written all in Smalltalk, and that seems efficient enough on our computers.
Is it a problem on Pi?
IMHO, the thing to do would be to document the primitive as backward compatibility support only (interpreter VM)
In case of COG, since there is no such backward compatibility anyway, drop the primitives.

Please don't drop it. Cuis is using it right now. In addition, it is not impossible to build closures (and Cog) enabled variations of  other relevant images forked before 3.8, that don't include i18n. For example, Scratch or Sophie. When I converted Cuis to closures, I did (and published) a better way to do the conversion, in the hope that others would use it to convert other images...

Besides, I think it could also be possible to make good use of the primitive for newer Squeak images, when using pure ASCII (i.e. Smalltalk code), and on slow hardware as the PI. Of course, some work would be needed for this.

Or rewrite them to support i18n...


2013/7/21 tim Rowledge <[hidden email]>
Clearing out old bug reports can be very alarming. Take this one -
http://bugs.squeak.org/view.php?id=1650

Between 3.7 & 3.8 the shape of CharacterScanner was changed in such a way that the scan characters primitive (much beloved by us ancient and gray vm hackers) cold not work. That's what, 9 years ago?

I'm not sure what the best 'fix' is. Fix the prim? Fix the image? Drop the prim entirely from the current images?

But really - changing  a core vm-known class so the vm doesn't know it any more? Ouch. Bad programmer. Sit in the naughty corner!

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Has an inferiority complex, but not a very good one.




Cheers,
Juan Vuletich



Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

timrowledge

On 21-07-2013, at 5:55 PM, "Juan Vuletich (mail lists)" <[hidden email]> wrote:

> Quoting Nicolas Cellier <[hidden email]>:
>
>> Clearly, character scanning inner loop is now written all in Smalltalk, and that seems efficient enough on our computers.
>> Is it a problem on Pi?
>> IMHO, the thing to do would be to document the primitive as backward compatibility support only (interpreter VM)
>> In case of COG, since there is no such backward compatibility anyway, drop the primitives.
>
> Please don't drop it. Cuis is using it right now.

Fair point; if it is still a useful primitive to any current usages, then it ought to stay around. Certainly in the plain interpreter it is needed for the really old images - like Scratch.

> In addition, it is not impossible to build closures (and Cog) enabled variations of  other relevant images forked before 3.8, that don't include i18n. For example, Scratch or Sophie.

Scratch actually has i18n except a really odd form that drastically needs replacing for modern images. I'm tearing my hair out over it.


> When I converted Cuis to closures, I did (and published) a better way to do the conversion, in the hope that others would use it to convert other images...
>
> Besides, I think it could also be possible to make good use of the primitive for newer Squeak images, when using pure ASCII (i.e. Smalltalk code), and on slow hardware as the PI. Of course, some work would be needed for this.

We could, for example, fix the primitive to handle a nil map array, just as the older backup code did. It would also have to cope with a different instance variable layout… maybe it would be better to add a new primitive instead? At least that would be clean. Since current images  can't use the old primitive they'd lose nothing and future images would gain the new primitive.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
I majored in Art and Logic. Now I draw my own conclusions



Reply | Threaded
Open this post in threaded view
|

Re: Ancient Mantis Report - 1650 PrimitiveScanCharacters

timrowledge
In reply to this post by Nicolas Cellier
Note that http://bugs.squeak.org/view.php?id=1781 also relates to this area. Mind you, I can't see much use of StrikeFontSets so perhaps it is no longer important.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Bother!" said Pooh, as he stood up to his waist in a cow pat.