[Haskell-cafe] I miss OO

Gregg Reynolds dev at mobileink.com
Thu Nov 26 09:49:27 EST 2009


On Thu, Nov 26, 2009 at 6:44 AM, Stephen Tetley
<stephen.tetley at gmail.com> wrote:
> 2009/11/26 Gregg Reynolds <dev at mobileink.com>:
>
>> Modeling musical stuff could provide an excellent illustration of the
>> difference between OO and the Haskell way; it's the difference between
>> metaphysical engineering and constructive mathematics.
>
>
> Hmm, Stephen Travis Pope's SmOKe - a design that has been the basis of
> various state-of-the-art Smalltalk music systems - seems pretty
> concrete to me rather than metaphysical.
>
> http://heaveneverywhere.com/stp/PostScript/icmc.94.mode.pdf
>

Looks interesting, but what I was trying to get at - ``metaphysical
engineering'' just popped into my head and sounded kinda cool so I
went with it - is that these are two radically different ways of
thinking about what we're doing when we write programs.

For example, Pope talks about music in terms of properties, but then
says "[t]hese properties may be music-specific _objects_ (such as
pitches or spatial positions)..." (emphasis added).  This is standard
OO-speak; there's nothing wrong with it, the point is just that the
domain of interest is viewed as a collection of ``objects'' and their
behaviors, where ``object'' is the word we use for lack of a better
term to refer to things that exist - hence metaphysics.  Are there
_really_ any objects involved, especially where properties are
concerned?  Not for me, though others may differ.  In any case, the
overall picture is that programs are combinations of such objects, so
the program is viewed as the description of a kind of machine - hence
engineering.  In order to describe music, the programmer describes a
machine.

By contrast, a ``purely functional'' approach (I prefer ``algebraic''
as more accurate or at least more revealing) might construe such
properties in terms of  types and operations on values of the types,
which capture the notion of property directly without implicating
objects in any way.  A music library would be viewed in terms of a
language (algebra), with customized names for domain-specific types
and operations, that the programmer can use to describe music instead
of describing a machine that produces music.  Which makes the
programmer a litterateur rather than a constructor of machines, among
other things.

Cheers,

Gregg


More information about the Haskell-Cafe mailing list