[TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages
andrews at csd.uwo.ca
Fri Apr 19 21:16:39 EDT 2013
Hi Bob and others...
It seems to have been Floyd, in his Turing award lecture, who
popularized the use of the term "paradigm" in reference to programming
Floyd cites Kuhn's _The Structure of Scientific Revolutions_ in
the text of the lecture. Kuhn had a specific use for the word
"paradigm" which is not particularly close to the original dictionary
definition (in the book, he apologizes for the appropriation of the
word). However, the way in which Floyd uses "paradigm" in his Turing
award lecture is closer to the original meaning of the word, and is
similar to what we would now call a "design pattern".
Despite all this, most of the discussion of "programming
paradigms" that I remember from the 1980s and 1990s seems to have taken
place with Kuhn's definition lurking under the surface. This discussion
seemed to assume a sort of striving between paradigms, that would result
in one becoming the "dominant" paradigm. This may have reflected no
more than the recognition that programming languages ranged from "wildly
successful" to "virtually unused, even by the inventor", and the desire
to be the inventor of a wildly successful language (or a co-author /
student / colleague of the inventor).
The current relative popularity of programming languages shows
that even a poorly-designed language can be very popular, for no better
reason than that it was once allied with a well-designed operating
system popular in universities. So the word "paradigm", with its heavy
Kuhnian overtones, is probably no longer useful.
What Floyd seems to have intended to point out is that some
paradigms (read: design patterns) are easier to use in some programming
languages than in others. I think this is the really interesting point
that the programming language community has actually been pursuing all
along, and that the "paradigm battle" has been an annoying distraction.
It is certainly possible to define programming languages that
combine imperative, functional, logic-programming and object-oriented
features. Many such languages have been defined in the past.
Why is research into such languages not the dominant mode of
programming language research? Perhaps it is partly that such languages
tend to have large grammar definitions that extend over several pages
(so does C++, but never mind). But partly it may be that the "paradigm
battle" has led to people wanting to avoid seeming to encourage or
accept a reconciliation between the supposed enemies.
I really like new programming languages that give programmers the
opportunity to use many different paradigms (again read: design
patterns), to use new paradigms, and to mix and match paradigms in
interesting new ways. I also like programming languages that do not
have several-pages-long grammars. There is a certain dynamic tension
between those two goals, of course, but it seems to me that some of the
best programming language research balances those goals well.
On 18/04/13 5:14 PM, Robert Harper wrote:
> [ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list ]
> In short, there is no such thing as a "paradigm". I agree fully. This term is a holdover from the days when people spent time and space trying to build taxonomies based on ill-defined superficialities. See Steve Gould's essay "What, If Anything, Is A Zebra?". You'll enjoy learning that there is, in fact, no such thing as a zebra---there are, rather, three different striped horse-like mammals, two of which are genetically related, and one of which is not. The propensity to be striped, like the propensity to have five things (fingers, segments, whatever) is a deeply embedded genetic artifact that expresses itself in various ways.
> Bob Harper
> On Apr 18, 2013, at 2:48 PM, Jason Wilkins wrote:
>> [ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list ]
>> Warning, this is a bit of a rant.
>> That paragraph from Wikipedia seems to be confused. It gives the fourth
>> paradigm as "declarative" but then says "first order logic for logic
>> programming". It seems somebody did an incomplete replacement of
>> "declarative" for "logic". Wikipedia is often schizophrenic like that.
>> Personally, I think that object oriented and logical programming only
>> became official paradigms because there was a certain level of hype for
>> them in the 1980s and nobody has thought to strike them off the list after
>> the hype died down.
>> Object-oriented, as constituted today, is just a layer of abstraction over
>> imperative programming (or imperative style programming in functional
>> languages, because objects require side-effects). What "object-oriented"
>> language actually in use now isn't just an imperative language with fancy
>> abstraction mechanisms?
>> The problem with having declarative languages as a paradigm (which logical
>> languages would be a part) is that it feels like it should be a
>> "miscellaneous" category. Being declarative doesn't tell you much except
>> that some machine is going to turn your descriptions of something into some
>> kind of action. In logical programming it is a set of predicates, but it
>> could just as easily be almost anything else. In a way all languages are
>> "declarative", it is just that we have some standard interpretations of
>> what is declared that are very common (imperative and functional).
>> My wish is that the idea of there being four paradigms would be abandoned
>> the same we the idea of four food groups has been abandoned (which may
>> surprise some of you). We have more than four different modes of thinking
>> when programming and some are much more important than others and some are
>> subsets of others. We should teach students a more sophisticated view.
>> Ironically Wikipedia also shows us this complexity. The
>> programming language paradigm side bar actually reveals the wealth
>> of different styles that are available. There is simply no clean and
>> useful way to overlay the four paradigms over what we see there, so it
>> should be abandoned because it gives students a false idea.
>> On Wed, Apr 17, 2013 at 9:42 AM, Andreas Abel <andreas.abel at ifi.lmu.de>wrote:
>>> [ The Types Forum, http://lists.seas.upenn.edu/**
>>> On 17.04.2013 11:30, Uday S Reddy wrote:
>>>> Mark Janssen writes:
>>>> From: en.wikipedia.org: Programming_paradigm:
>>>>> "A programming paradigm is a fundamental style of computer
>>>>> programming. There are four main paradigms: object-oriented,
>>>>> imperative, functional and declarative. Their foundations are distinct
>>>>> models of computation: Turing machine for object-oriented and
>>>>> imperative programming, lambda calculus for functional programming,
>>>>> and first order logic for logic programming."
>>> I removed the second sentence relating paradigms to computation models
>>> and put it on the talk page instead. It does not make sense to connect
>>> imperative programming to Turing machines like functional programming to
>>> lambda calculus. A better match would be random access machines, but the
>>> whole idea of a connection between a programming paradigm and a computation
>>> model is misleading.
>>> While I understand the interest in purely theoretical models, I wonder
>>>>> two things: 1) Are these distinct models of computation valid? And,
>>>>> 2) If so, shouldn't a theory of types announce what model of
>>>>> computation they are working from?
>>>> These distinctions are not fully valid.
>>>> - Functional programming, logic programming and imperative programming are
>>>> three different *computational mechanisms*.
>>>> - Object-orientation and abstract data types are two different ways of
>>>> building higher-level *abstractions*.
>>>> The authors of this paragraph did not understand that computational
>>>> mechanisms and higher-level abstractions are separate, orthogonal
>>>> in programming language design. All six combinations, obtained by
>>>> picking a
>>>> computational mechanism from the first bullet and an abstraction mechanism
>>>> from the second bullet, are possible. It is a mistake to put
>>>> object-orientation in the first bullet. Their idea of "paradigm" is vague
>>>> and ill-defined.
>>>> Uday Reddy
>>> Andreas Abel <>< Du bist der geliebte Mensch.
>>> Theoretical Computer Science, University of Munich
>>> Oettingenstr. 67, D-80538 Munich, GERMANY
>>> andreas.abel at ifi.lmu.de
>>> http://www2.tcs.ifi.lmu.de/~**abel/ <http://www2.tcs.ifi.lmu.de/~abel/>
More information about the Types-list