Von Rossum on Strong vs. Weak Typing

Thu, 13 Feb 2003 10:10:44 +0900, jbritt@ruby-doc.org jbritt@ruby-doc.org pisze:

Strong versus Weak Typing
A Conversation with Guido van Rossum, Part V
by Bill Venners with Frank Sommers
February 10, 2003

artima - Strong versus Weak Typing

It’s a pity that people judge about static typing by seeing only
C++ and Java.

Where is OCaml? Haskell? Eiffel? They don’t have mentioned problems
with generics, and languages with Hindley-Milner typing (OCaml,
Haskell, SML, Clean) require much less changes than explicitly-typed
languages when the type of something which is just passed down
is changed.

···


__("< Marcin Kowalczyk
__/ qrczak@knm.org.pl
^^ Blog człowieka poczciwego.

Thu, 13 Feb 2003 10:10:44 +0900, jbritt@ruby-doc.org jbritt@ruby-doc.org
pisze:

Strong versus Weak Typing
A Conversation with Guido van Rossum, Part V
by Bill Venners with Frank Sommers
February 10, 2003

artima - Strong versus Weak Typing

It’s a pity that people judge about static typing by seeing only
C++ and Java.

Where is OCaml? Haskell? Eiffel? They don’t have mentioned problems
with generics, and languages with Hindley-Milner typing (OCaml,
Haskell, SML, Clean) require much less changes than explicitly-typed
languages when the type of something which is just passed down
is changed.

Very true. In my opinion adding Hindley-Milner typing to Ruby would be a huge
gain in reliability.

Note that there is a project underway to do this for Python, with a couple of
papers already published.

Also, the argument in the referenced article is astoundingly weak. It doesn’t
address the important issues. It also ignores the fact that type
verification by testing is proveable impossible.

···

On Wednesday 26 February 2003 01:21 pm, Marcin ‘Qrczak’ Kowalczyk wrote:


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

I think you could with a realistic amount of effort write a Ruby syntax in
OCaml’s CamlP4 preprocessor tool. You would loose a lot of Ruby’s dynamic
nature, but I believe you would cover 90% of practical use especially if
you can find a way to extend classes with new methods using some exception
handling mechanism.
However, adding a formal static type system to Ruby as such would probably
be very difficult. When OCaml eventually gets support for generics, a new
very interesting language with many Ruby like features could emerge.

Ruby will, however, remain Ruby with its extreme flexibility.

Mikkel

···

On Thu, 27 Feb 2003 06:01:32 +0900, Seth Kurtzberg seth@cql.com wrote:

Where is OCaml? Haskell? Eiffel? They don’t have mentioned problems
with generics, and languages with Hindley-Milner typing (OCaml,
Haskell, SML, Clean) require much less changes than explicitly-typed
languages when the type of something which is just passed down
is changed.

Very true. In my opinion adding Hindley-Milner typing to Ruby would be a
huge gain in reliability.

Seth Kurtzberg seth@cql.com writes:

···

On Wednesday 26 February 2003 01:21 pm, Marcin ‘Qrczak’ Kowalczyk wrote:

Thu, 13 Feb 2003 10:10:44 +0900, jbritt@ruby-doc.org jbritt@ruby-doc.org
pisze:

Strong versus Weak Typing
A Conversation with Guido van Rossum, Part V
by Bill Venners with Frank Sommers
February 10, 2003

artima - Strong versus Weak Typing

It’s a pity that people judge about static typing by seeing only
C++ and Java.

Where is OCaml? Haskell? Eiffel? They don’t have mentioned problems
with generics, and languages with Hindley-Milner typing (OCaml,
Haskell, SML, Clean) require much less changes than explicitly-typed
languages when the type of something which is just passed down
is changed.

Very true. In my opinion adding Hindley-Milner typing to Ruby would
be a huge gain in reliability.

As far as I understand it (which isn’t that far), adding
Hindley-Milner type inferencing to an OO language with super/sub-type
relationships is at least difficult if not impossible. For a take on
adding OO to a type inferenced language (SML) rather than adding type
inferencing to an OO language take a look at the Moby site:
http://moby.cs.uchicago.edu/


2, 3, 3 & 37: the Prime Factors of the Beast.

I’m not Dutch/Nederlands, but I think it’s Van Rossum, or Guido van Rossum.

Your weak typing is showing :slight_smile:

That makes no sense. If you can add super/subtyping to a type inferenced
language, then you can add type inference to a super/subtype language. If it
is impossible in one case it is also impossible in the other.

···

On Friday 28 February 2003 10:25 am, Arthur Chance wrote:

Seth Kurtzberg seth@cql.com writes:

On Wednesday 26 February 2003 01:21 pm, Marcin ‘Qrczak’ Kowalczyk wrote:

Thu, 13 Feb 2003 10:10:44 +0900, jbritt@ruby-doc.org
jbritt@ruby-doc.org

pisze:

Strong versus Weak Typing
A Conversation with Guido van Rossum, Part V
by Bill Venners with Frank Sommers
February 10, 2003

artima - Strong versus Weak Typing

It’s a pity that people judge about static typing by seeing only
C++ and Java.

Where is OCaml? Haskell? Eiffel? They don’t have mentioned problems
with generics, and languages with Hindley-Milner typing (OCaml,
Haskell, SML, Clean) require much less changes than explicitly-typed
languages when the type of something which is just passed down
is changed.

Very true. In my opinion adding Hindley-Milner typing to Ruby would
be a huge gain in reliability.

As far as I understand it (which isn’t that far), adding
Hindley-Milner type inferencing to an OO language with super/sub-type
relationships is at least difficult if not impossible. For a take on
adding OO to a type inferenced language (SML) rather than adding type
inferencing to an OO language take a look at the Moby site:
http://moby.cs.uchicago.edu/


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

Seth Kurtzberg seth@cql.com writes:

Seth Kurtzberg seth@cql.com writes:

Very true. In my opinion adding Hindley-Milner typing to Ruby would
be a huge gain in reliability.

As far as I understand it (which isn’t that far), adding
Hindley-Milner type inferencing to an OO language with super/sub-type
relationships is at least difficult if not impossible. For a take on
adding OO to a type inferenced language (SML) rather than adding type
inferencing to an OO language take a look at the Moby site:
http://moby.cs.uchicago.edu/

That makes no sense. If you can add super/subtyping to a type inferenced
language, then you can add type inference to a super/subtype language. If it
is impossible in one case it is also impossible in the other.

I think I wasn’t clear enough. You can have some type inferencing but
you can’t do full Hindley-Milner inferencing in OO systems. If you
read the Moby papers you’ll find they have abandoned H-M type
inferencing and you have to declare the types of methods. Given those
they can infer the types of the local variables in the method bodies.
The paper The design of a class mechanism for MOBY by Fisher and
Reppy explicitly states:

Another consequence of supporting subtyping is that ML-style type
inference is not possible.
···

On Friday 28 February 2003 10:25 am, Arthur Chance wrote:


2, 3, 3 & 37: the Prime Factors of the Beast.

Seth Kurtzberg seth@cql.com writes:

Seth Kurtzberg seth@cql.com writes:

Very true. In my opinion adding Hindley-Milner typing to Ruby would
be a huge gain in reliability.

As far as I understand it (which isn’t that far), adding
Hindley-Milner type inferencing to an OO language with super/sub-type
relationships is at least difficult if not impossible. For a take on
adding OO to a type inferenced language (SML) rather than adding type
inferencing to an OO language take a look at the Moby site:
http://moby.cs.uchicago.edu/

That makes no sense. If you can add super/subtyping to a type inferenced
language, then you can add type inference to a super/subtype language.
If it is impossible in one case it is also impossible in the other.

I think I wasn’t clear enough. You can have some type inferencing but
you can’t do full Hindley-Milner inferencing in OO systems. If you
read the Moby papers you’ll find they have abandoned H-M type
inferencing and you have to declare the types of methods. Given those
they can infer the types of the local variables in the method bodies.
The paper The design of a class mechanism for MOBY by Fisher and
Reppy explicitly states:

I don’t disagree that you can’t do full Hindley-Milner inferencing. However,
I do disagree with the (common) assertion that if you can’t do full HM
inferencing, then it isn’t useful to try and to any inferencing.

···

On Saturday 01 March 2003 08:07 am, Arthur Chance wrote:

On Friday 28 February 2003 10:25 am, Arthur Chance wrote:

Another consequence of supporting subtyping is that ML-style type
inference is not possible.


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

Seth Kurtzberg seth@cql.com writes:
[Me, on OO & H-M type inferencing not mixing]

I don’t disagree that you can’t do full Hindley-Milner inferencing.
However, I do disagree with the (common) assertion that if you can’t
do full HM inferencing, then it isn’t useful to try and to any
inferencing.

I wouldn’t disagree with you in the slightest. That’s one of the
reasons I’m interested in Moby.

···


2, 3, 3 & 37: the Prime Factors of the Beast.