Adaptation in HOT Languages
started 7/18/2003; 7:52:10 AM - last post 7/19/2003; 3:12:38 AM
|
|
Chris Rathman - Adaptation in HOT Languages
7/18/2003; 7:52:10 AM (reads: 2385, responses: 6)
|
|
Adaptation in HOT Languages |
From Dave McQueen of the SML-NJ team with an accompanying Powerpoint presentation.
What with Higher Order Type Systems being a "hot" topic of discussion and me being in the middle of working thru The Little MLer, this paper caught my eye. The paper describes the similarity and differences between FP and OOP languages, without getting too bogged down. A good exposition on FP for those that come from an OO background (such as myself).
From the point of view of FP, what does OO have to offer? There is the clear utility of subtyping. There is state encapsulization (which can be provided by function closures or modules in ML). There is implementation inheritance, which we have argued is a mixed blessing. And finally there is the clear popular success of OO programming in the real world, which functional programming has not achieved so far.
From the OO point of view, FP offers firstclass functions as a lighter weight and more general way of binding data and code. It offers true parametric polymorphism (as opposed to macrolike templates), and it offers elegant and concise processing of treelike data through algebraic data types with pattern matching. It offers clean and powerful module systems that go well beyond the capabilities of namespace management features like packages in Java.
Posted to functional by Chris Rathman on 7/18/03; 8:30:21 AM
|
|
|
|
Patrick Logan - Re: Adaptation in HOT Languages
7/18/2003; 10:54:53 AM (reads: 650, responses: 0)
|
|
"...the value-oriented, mostly functional style of FP is very successful at decreasing program complexity, and it does not blend well with the heavily state-oriented style of OO... Perhaps the best approach would be to add a few modest extensions to a functional language..."
I am not sure MacQueen understands the context where OO is best leveraged is in complex, stateful problems. In my experience with languages like Lisp and Smalltalk, and to a far lesser extent with Haskell and ML, by the time you get to these complex scenarios the payoff is *how* you've used these languages. Complex problems come down to the programmer using the tool more than the tool itself.
Adding a few modest extensions to ML will not significantly increase its appeal to programmers using OO languages. It seems to me six of one, half dozen of the other.
|
|
Chris Rathman - Re: Adaptation in HOT Languages
7/18/2003; 11:17:44 AM (reads: 644, responses: 0)
|
|
Adding a few modest extensions to ML will not significantly increase its appeal to programmers using OO languages. It seems to me six of one, half dozen of the other. MacQueen conclusion is much the same (though he expresses it more explicitly near the end of the ppt presentation than he does in the original paper).
Be that as it may, language experimentation will result in various combinations of FP into mainstream languages, as well as OO into FP languages. One need look no further than Generics being experimented with in Java & C# or to OO injected into ML in O'Caml or Moby. (Language designers are invariably drawn to mix their metaphors).
I don't know that the primary purpose of such experimentation is necessarily mass appeal. I just think that it's the form that evolution takes in this particular form of language.
|
|
Isaac Gouy - Re: Adaptation in HOT Languages
7/18/2003; 12:50:06 PM (reads: 617, responses: 1)
|
|
"The HOT category includes functional languages such as ML and
Haskell, as well as typed object-oriented languages like Java and Eiffel."
Dang! I haven't been thinking of HOT including Java and Eiffel.
I wonder what commentary accompanied slide 212?
Language design criticism
Should the study of language designs be like botany or horticulture?
|
|
Patrick Logan - Re: Adaptation in HOT Languages
7/18/2003; 12:57:22 PM (reads: 620, responses: 0)
|
|
I don't know that the primary purpose of such experimentation is necessarily mass appeal.
In the quote above MacQueen states a desire to capitalize on the mass appeal of OO style...
...the clear popular success of OO programming in the real world, which functional programming has not achieved so far...
The paper and slides are foundational, as is the paper from Peyton-Jones, et al. listed earlier in the week. Neither get to the heart of the matter, though, which will require examining how large systems are built, tested, and maintained in both styles by accomplished programmers.
That I would like to see, and benefit from.
|
|
Marc Hamann - Re: Adaptation in HOT Languages
7/18/2003; 1:03:00 PM (reads: 634, responses: 0)
|
|
Should the study of language designs be like botany or horticulture?
I'm guessing he means descriptive (botany) vs. prescriptive (horticulture).
|
|
Ehud Lamm - Re: Adaptation in HOT Languages
7/19/2003; 3:12:38 AM (reads: 561, responses: 0)
|
|
The following slide is a useful summary of some of the things that can go wrong when designing a type system, so I wanted to extract it for future reference:
- type system is unsound (i.e. inconsistent with the evaluation semantics)
- type system is undecidable (i.e. can’t find a terminating algorithm for discovering typings)
- type system is incomplete (can’t find typings for “sensible” expressions)
- typings are not canonical (i.e. terms have multiple typings, none of which is “best”)
- type system is too complex or difficult to use to be practical (e.g. not enough inference)
|
|
|
|