Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1382 > unrolled thread

Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha)

Started by"Nils M Holm" <nmh@t3x.org>
First post2014-09-20 02:19 -0400
Last post2014-09-21 14:28 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.compilers


Contents

  Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha) "Nils M Holm" <nmh@t3x.org> - 2014-09-20 02:19 -0400
    Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-09-21 13:40 +0000
      Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha) Kaz Kylheku <kaz@kylheku.com> - 2014-09-21 14:28 +0000

#1382 — Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha)

From"Nils M Holm" <nmh@t3x.org>
Date2014-09-20 02:19 -0400
SubjectRe: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha)
Message-ID<14-09-016@comp.compilers>
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> Martin Ward <martin@gkc.org.uk> writes:
> > But Smalltalk, for which development started in 1969, was a very early
> > functional object-oriented language.
>
> Smalltalk is an imperative language; e.g., it contains assignment and
> its objects contain changeable state.  What makes you think that
> Smalltalk is functional?

While I would agree that Smalltalk is not intended to be a functional
language, I think the argument of assignment and mutable state is not
valid.

In "The Definition of Standard ML", Milner, et al describe ML as a
functional language "in the sense that the full power of mathematical
functions is present". IMO, this property is sufficient to classify a
language as "functional". Even SML does have mutable state (references)
and assignment, BTW.

--
Nils M Holm  < n m h @ t 3 x . o r g >  www.t3x.org
[Does that make python functional? -John]

[toc] | [next] | [standalone]


#1383

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2014-09-21 13:40 +0000
Message-ID<14-09-017@comp.compilers>
In reply to#1382
"Nils M Holm" <nmh@t3x.org> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>> Smalltalk is an imperative language; e.g., it contains assignment and
>> its objects contain changeable state.  What makes you think that
>> Smalltalk is functional?
>
>While I would agree that Smalltalk is not intended to be a functional
>language, I think the argument of assignment and mutable state is not
>valid.

Why not?  It's how you know whether a language is imperative or
declarative.

>In "The Definition of Standard ML", Milner, et al describe ML as a
>functional language "in the sense that the full power of mathematical
>functions is present". IMO, this property is sufficient to classify a
>language as "functional". Even SML does have mutable state (references)
>and assignment, BTW.

So SML is an imperative language and a functional language then.
These days one tends to avoid that, because with mutable state, you
don't get referential transparency, and without referential
transparency, you miss out on some benefits of functional languages;
but in earlier times people did not know how to live without mutable
state, so they had mutable state in functional languages.  Quite a lot
in Lisp, less in ML, nothing in Haskell (or at least the imperative
stuff is encapsulated in a way that avoids destroying referential
transparency for the functional part).

- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/

[toc] | [prev] | [next] | [standalone]


#1384

FromKaz Kylheku <kaz@kylheku.com>
Date2014-09-21 14:28 +0000
Message-ID<14-09-018@comp.compilers>
In reply to#1383
On 2014-09-21, Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> ...
> So SML is an imperative language and a functional language then.
> These days one tends to avoid that, because with mutable state, you
> don't get referential transparency, and without referential
> transparency, you miss out on some benefits of functional languages;
> but in earlier times people did not know how to live without mutable
> state, so they had mutable state in functional languages.

Those people haven't gone away, and in fact there is more of them.
So the functional languages that dropped mutable state simply
dropped users. :)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.compilers


csiph-web