[Pharo-dev] Smalltalk = strongly typed

Igor Stasenko siguctua at gmail.com
Fri Aug 2 06:07:34 EDT 2013


On 2 August 2013 06:03,  <btc at openinworld.com> wrote:
> greetings all,
>
> I'm in the final weeks of writing up my Masters dissertation and seeking
> some scholarly references to Smalltalk being "Strongly Typed."
>
> I my review of Smalltalk I was surprised to find that [1] describes
> Smalltalk as Strongly Typed, since Smalltalk is sometimes denigrated as
> being untyped / weakly typed. From reviewing discussion forums this now
> makes sense, but I can only find one of scholarly reference that briefly
> mentions this [2].  The most enlightening is [3] which defines Type Strength
> as:
>
> "A strongly typed language prevents any operation on the wrong type of data.
> In weakly typed languages there are ways to escape this restriction: type
> conversions"
>
> meaning that getting a MNU is a form of Strong Typing since you can't make a
> Smalltalk object run a method that is not its own.  The problem appears to
> be that Strong Typing has been synonymous with Static Typing for a long
> time, and Static Typing strongly ties types to variables, except in
> Dynamically Typed languages, I think types can be considered independently
> from variables, in which case the definition of [3] has some merit, hence
> Smalltalk is Strongly Typed.
>
> Sounds controversial, so I'm just hoping for some peer reviewed backup - but
> only you have something easily to hand. This is just a small thing I can
> just leave out if necessary.
>

There's not much controversy..
C, for instance is weakly typed, since you can say:

unsigned int a = 10;
int b = a;

but at same time, C is statically typed language.
So apparently 'strong' is not synonym to 'static'.


> cheers -ben
>
> [1] http://www.squeak.org/Features/
> [2] p15,
> http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.35.7507&rep=rep1&type=pdf
> [3] http://www.cs.kuleuven.ac.be/publicaties/rapporten/cw/CW415.pdf
>



-- 
Best regards,
Igor Stasenko.




More information about the Pharo-dev mailing list