Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: michel.schinz@csem.ch (Michel Schinz)
Cc: caml-list@inria.fr (OCAML)
Subject: Re: Looking for a nail
Date: Thu, 28 Jan 1999 15:13:09 +0100 (MET)	[thread overview]
Message-ID: <199901281413.PAA10768@miss.wu-wien.ac.at> (raw)
In-Reply-To: <usocvsox6.fsf@csem.ch> from "Michel Schinz" at Jan 28, 99 10:54:29 am

> Markus Mottl <mottl@miss.wu-wien.ac.at> writes:
> 
> [...]
> > There is even a much more radical approach concerning OO: Make all
> > basic types classes! This would e.g. allow to put all kinds of
> > values into a list and iterate it with a print function - just one
> > of many other then possible things I miss...
> 
> I'm not sure this is such a good idea for CAML. The non-OO part of
> CAML is quite mature, while the OO part is more like research. Forcing
> everybody to use CAML as an OO language is IMHO not a very nice thing.
> I do not use the OO part of CAML at all right now, and I'm pretty sure
> I'm not the only one. I think we need more experience with the OO part
> of CAML (or, more fundamentally with OO programming in a functional
> language) before choosing to use it for basic types.
> 
> Don't get me wrong, I have nothing against purely-OO languages. I
> *love* Self, Smalltalk, ... I just think that it's not appropriate for
> CAML at this time. Later, when we have more experience, maybe, but not
> now.

I didn't say that one should be forced to use objects (I sometimes prefer
modules - or even have to take them).

But I think it would be possible to let people use all basic types
as if they were classes without breaking code of other people.  Thus,
if someone doesn't like objects - he needs not necessarily use them.

I wonder whether this is a big task for camlp4 - translating every
appearance of a basic type in the source to an appropriate construction
of an object and all standard functions to appropriate method calls.
I am not so experienced in camlp4, but I believe it could work.

So there is no need to change the compiler - especially, since the
OO-system is still under development. Changing just the preprocessor
(the rules) is certainly not so much work.

> [...]
> > As Okasaki shows, most kinds of data structures can be implemented
> > in a very efficient and still purely applicative way. I am not sure
> > whether there are many data structures that deserve their existence
> > in both forms...
> 
> I think that having arrays with in-place modification is almost a
> must, for example. For some applications, having only functional
> arrays is pretty awful.

Although there are more or less efficient implementations of functional
arrays, I would not want to trade them against "real" arrays (not yet).

As I wrote above (probably just a misunderstanding):

  I am not sure whether there are many data structures that deserve
  their existence in *both forms*...

I don't want to have everything functional nor everything imperative
(of course), but I definitely don't want to have both versions if they
otherwise behave exactly the same (time/memory complexity, comparable
performance). I think this would lead to a lot of confusion (which one
to choose now?).

> I agree with you that for some data-structures, having a
> non-functional version when the functional one is efficient is maybe
> not such a good idea.

Exactly my opinion.

Best regards,
Markus

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl




  reply	other threads:[~1999-01-28 19:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-24 21:06 Miles Egan
1999-01-24 23:01 ` Lyn A Headley
1999-01-25  8:44   ` Jean-Christophe Filliatre
1999-01-25 20:45     ` Markus Mottl
1999-01-25 13:36   ` mattwb
1999-01-25 20:48     ` Trevor Jim
1999-01-25 21:57   ` Gerd Stolpmann
1999-01-25 12:45 ` Michel Schinz
1999-01-25 20:37   ` Markus Mottl
1999-01-28  9:54     ` Michel Schinz
1999-01-28 14:13       ` Markus Mottl [this message]
1999-01-25 20:53 Hendrik Tews
1999-01-26 19:20 ` Ian T Zimmerman
1999-01-28  1:30   ` John Prevost
1999-01-28 20:10   ` Hendrik Tews
1999-01-27  1:29 ` Jacques GARRIGUE
1999-01-27  8:27 ` Jean-Christophe Filliatre
1999-01-28  9:34 ` Cuihtlauac ALVARADO
1999-01-28 13:32 Don Syme
1999-01-29  0:25 ` Markus Mottl
1999-01-31 18:43 ` John Whitley
1999-01-29  0:45 Frank A. Christoph

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199901281413.PAA10768@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=caml-list@inria.fr \
    --cc=michel.schinz@csem.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox