[squeak-dev] Re: Transform sends to ANSI standard?

Hernán Morales Durand hernan.morales at gmail.com
Thu Sep 27 16:06:03 UTC 2012


On 25/09/2012 19:35, Benoit St-Jean wrote:
> On 25/09/2012 2:31 PM, Hernán Morales Durand wrote:
>>
>> Hi folks,
>> I am rewriting packages to be compatible or more portable between
>> Smalltalks. Code Critics gives the following information on my packages:
>>
>> - #cr, #crlf, #lf, #space, #tab, #findTokens:, ... are not part of the
>> ANSI string protocol.
>>
>> - #cr and #lf are not part of the ANSI stream protocol.
>>
>> - The ANSI standard does not support #asInteger and #asString on Object.
>>
>> - Some collection methods are not ANSI compatible: #pairsDo:,
>> #collect:thenDo:, #reject:thenDo:, #detectSum:, #valuesDo:,
>> #keysSortedSafely, #new:withAll:, etc.
>>
>> Does anyone have an idea on how to transform those sends to be ANSI
>> compatible?
>
> Hi Hernan,
>
> I don't think being ANSI-compatible should be a goal in any case.  You
> won't find any Smalltalk flavor (commercial or Open Source) that is
> fully ANSI-compatible.  All vendors have their
> extensions/exceptions/versions.  Just have a look at Glorp to convince
> yourself of differences between Smalltalk implementations!
>
> But if your goal is portability, I'd say you should start by having your
> code compatible with VAST, VW, Dolphin & Squeak.  You'll probably cover
> most of other Smalltalks variants by doing so.  The ANSI standard was
> never, to my knowledge, 100% fully respected by any Smalltalk vendor.
> Most of them tried to but none of them implemented it with 100%
> compliance.  In other words, just do your best at satisfying
> compatibility with the most vendors.

Hi Benoit,

Just for the record :) I've worked with a custom implementation of
Smalltalk which was 100% tested ANSI-compatible. It was in 2004 and
unfortunately the project never saw the light except for our customer.
However I wasn't in the team responsible for the ANSI compliance, but
for the testing. It was called "Chachara Smalltalk" and it has some
interesting features at that time: No object table, compacting
generational GC with variable # of generations, C++ VM with reified ST
meta-model, etc. You may see a screenshot here:

http://www.screencast.com/t/PGm5VPr0

that proves nothing, but sometimes it's nice to see screenshots.

>
> This one uses Xtreams, the other one Nautilus browser or Zinc, the other
> one starts Array indices at 1, this other one does this, the other one
> does that, one uses Smalltalk while the other uses SmalltalkImage, etc.
>

Yes, but the goal of the standard is to provide an ideal protocol of
behaviors. Globals are only defined if they conform a protocol. UI,
Database and Graphics were unspecified until Smalltalk implementations
converge... which could be never.

> Unfortunately, we're not in the Java world.  You'll eventually need a
> Bundle/Application/Project/Package named "Portability" just like
> everyone else...
>

I'm afraid so... I wonder what's the status of Grease. Any Seasider reading?

Cheers,

Hernán





More information about the Squeak-dev mailing list