Lambda the Ultimate

inactiveTopic Strong Typing - Comparison of ML with Pascal & C
started 11/17/2000; 7:31:30 AM - last post 11/30/2000; 2:01:03 PM
Chris Rathman - Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/17/2000; 7:31:30 AM (reads: 2610, responses: 10)
Strong Typing - Comparison of ML with Pascal & C
This is a presentation given by Mark Dominus that compares the Type Systems of these three languages. C and Pascal are not the pinnacle of statically typed languages - Ada and Eiffel would be a fairer fight - but since most people are familiar with these languages, it makes a good case for the attraction of ML Strong Typing.

The author approaches it from a Perl perspective and concludes that although Strong Typing is very attractive, Perl should remain a dynamic run time language.
Posted to "" by Chris Rathman on 11/17/00; 7:32:33 AM

Ehud Lamm - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/18/2000; 2:22:08 AM (reads: 2673, responses: 0)
Langugae with type inference (not to mention first class functions, and HOF) are so different in their approach to typing than languages wihtout type inference, that I wouldn't go about comparing them to conclude something about "type checking."

Each can be compared to dynamic typing (and win..)


In fact isn't it an absurd notion to learn about typing from someone with a Perl perspective?

Chris Rathman - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/18/2000; 6:58:33 AM (reads: 2673, responses: 0)
Langugae with type inference (not to mention first class functions, and HOF) are so different in their approach to typing than languages wihtout type inference, that I wouldn't go about comparing them to conclude something about "type checking."
It does confuse the issue of compile time type consistency with the issue of parametric polymorphism. If you go with a straight static type checking of Pascal and C, the type checking amounts to an explicit Ensure Contract between the function and the caller. Unlike DbC in Eiffel, though, this is a form of a Contract that can be enforced by the compiler well before the runtime regression checks.

Each can be compared to dynamic typing (and win..)
Dynamic vs. Static Typing is a pretty old debate and I'm still an undecided on the issue. For small programs and simple scripting, I think dynamically typed languages (Python, Perl, TCL, etc...) have the upper hand.

In fact isn't it an absurd notion to learn about typing from someone with a Perl perspective?
I've been caught too many times in the middle of the war between Python and Perl - so I'll probably steer clear of this lob. :-)

The main reason I find Dominus' articles to be a value (both this and the Lambda Calculus one) is that they give a perspective on the issues of Functional Programming that is a tad more accessible to all those masses of script programmers. Indeed, I commend the Perl crowd for trying to learn some lessons from FP.

I don't think we need worry about Perl 6 going strict about typing, but I do wonder if the prize sought by FP (verifiable programs) is a goal that is out of reach of an amalgamation language.

Ehud Lamm - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/20/2000; 2:16:31 AM (reads: 2649, responses: 0)
Some people were concerned with my views on Perl (see above)...

It was humour!

Chris Rathman - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/20/2000; 9:40:43 AM (reads: 2641, responses: 0)
Some people were concerned with my views on Perl (see above)... It was humour!
I figured as much. :-)

I did get a couple of notes from the author (Mark-Jason Dominus) of the article wherein he corrects some of my statements on his articles. I've written him back and asked whether I can post his comments. If he gives me a green light, I'll post them here.

The one good thing about getting corrections is that we at least know that there's some people getting to the page. Now if we could just get them to post here. :-)

Ehud Lamm - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/21/2000; 9:42:45 AM (reads: 2626, responses: 0)
Right.

The number of members is increasing. It is time to post another invitation for contributing editors.

So if you are reading this, and want to join Andrew, Chris and me as contributors, let me know!

Then you can post on the home page

Chris Rathman - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/22/2000; 12:27:38 AM (reads: 2617, responses: 0)
Got a couple of notes from the author that he said he didn't mind if I posted. Here's the first note he sent about the Strong Typing posting:

+++++++++++++++++++ Mark-Jason Dominus

You wrote:

This is a presentation given by Mark Dominus that compares the Type Systems of these three languages. C and Pascal are not the pinnacle of statically typed languages - Ada and Eiffel would be a fairer fight...

The point of the talk was not to have a 'fair fight'. I am not interested in have languages 'fight' with each other.

The reason I gave the talk is that a lot of people think that C and Pascal *are* the pinnacle of statically typed languages, and consequently they think of static typing as an idea whose time is past. I wanted to correct this misconception.

Chris Rathman - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/22/2000; 12:34:32 AM (reads: 2629, responses: 0)
The point of the talk was not to have a 'fair fight'. I am not interested in have languages 'fight' with each other.
I understand the author's reason for not wanting to engage in a Language War, and my post was more curt than it was reasoned out.

I agree that C and Pascal are good choices for helping most people understand the limitations of solutions in the past that are not applicable to the Strong Typing available in FP. Still, from a language history standpoint, I regard Ada as the logical conclusion to designing a static language that fills in some of the holes that were present in C and Pascal. Eiffel takes this methodical typing system and applies it to an OOP language (much more effectively than Ada'95 in my opinion).

That said, I do think that the FP languages (ML, Haskell, ...) up the ante another level with Strong Typing as the author stipulates. So the conclusion of the article would not have to be changed, even if the landscape of the languages examined were mixed differently.

Ehud Lamm - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/29/2000; 1:44:31 AM (reads: 2601, responses: 0)
This message on comp.lang.functional, can be viewed as an answer to what I wrote here a couple of days ago re type inference.

It gives an interesting (though not really surprising) perspective.

andrew cooke - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/30/2000; 1:43:00 PM (reads: 2601, responses: 0)
Ha. Wasn't (at least one) ML compiled into Scheme? Wonder what the Scheme for that ML looked like...

Ehud Lamm - Re: Strong Typing - Comparison of ML with Pascal & C  blueArrow
11/30/2000; 2:01:03 PM (reads: 2598, responses: 0)
I don't know about that. The reverse (Scheme -> ML) was discussed recently on comp.lang.scheme, in the course of some interesting threads about implementing Scheme (esp. continuations and being properly tail recursive).