[Python-ideas] [Wild Idea] Static Ducks

Michael Foord fuzzyman at gmail.com
Fri Sep 25 15:42:24 CEST 2009


2009/9/25 Gerald Britton <gerald.britton at gmail.com>

> I think that the idea that there is a continuum from weak typing to
> strong typing is useful.  At the weak end, the compiler lets you do
> anything with anything without any declarations.  At the strong end,
> you have to declare everything and explicitly code all type
> conversions.  In practice I suppose, no compiler is completely weak or
> completely strong in this regard.  It's probably possible to devise
> some sort of metric to be able to place a given language on the
> weak-strong scale.  That's not to say that one language is better than
> another for being stronger or worse for being weaker.  They're just
> different approaches and philosophies and target different sorts of
> problems.
>


The issue of type *declarations* is completely unrelated to strong or weak
typing. Haskell is one of the strongest typed languages there is - but the
types are usually inferred rather than declared. The compiler has a very
strong notion of types internally. Strong and weak typing are to do with the
way language treats 'objects' not how they are expressed in code (semantics
rather than syntax). Even C# these days has a very limited form of type
inferencing.

Michael


>
> Where would Python fall?  Probably towards the weak end.  Is that bad?  No
> way!
>
> On Thu, Sep 24, 2009 at 6:54 PM, Steven D'Aprano <steve at pearwood.info>
> wrote:
> > On Thu, 24 Sep 2009 07:04:46 pm Masklinn wrote:
> >> On 24 Sep 2009, at 01:40 , Steven D'Aprano wrote:
> >> > The world disagrees with you:
> >> >
> >> > […]
> >> > http://en.wikipedia.org/wiki/Weak_typing
> >>
> >> Not really:
> >>  > It is the opposite of strong typing, and consequently the term
> >>  > weak
> >>
> >> typing has as many different meanings as strong typing does
> >>
> >> Go to "strong typing" and you have a list of 9 different (and not
> >> necessarily compatible) definitions of "strong typing".
> >
> > How does Wikipedia stating that there are many definitions of weak
> > typing support your assertion that "there is not [sic] definition of
> > weak typing"? I think it is disingenuous of you to delete the text of
> > yours I quoted.
> >
> > The terms weak and strong typing are very common use in the real world.
> > If they don't have a single, formal, precise definition, that's too
> > bad, but it doesn't prevent them from being useful so long as we
> > remember that they are fuzzy terms. The English language is full of
> > words and terms with multiple definitions and fuzzy gradings. We manage
> > to communicate about relative differences in size quite well without a
> > single objective and precise definition of "large", and we can
> > communicate about relative differences in strength of the type system
> > of languages quite well without a single objective and precise
> > definition of type strength.
> >
> >
> >
> >
> > --
> > Steven D'Aprano
> > _______________________________________________
> > Python-ideas mailing list
> > Python-ideas at python.org
> > http://mail.python.org/mailman/listinfo/python-ideas
> >
>
>
>
> --
> Gerald Britton
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
http://www.ironpythoninaction.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090925/dddbb681/attachment.html>


More information about the Python-ideas mailing list