caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chet Murthy <chet@watson.ibm.com>
To: STARYNKEVITCH Basile <Basile.Starynkevitch@cea.fr>
Cc: Joe Lisp <joelisp@yahoo.com>, caml-list@inria.fr
Subject: Re: callcc/cps-style programming
Date: Sat, 09 Dec 2000 13:48:59 -0500	[thread overview]
Message-ID: <200012091848.NAA01988@bismarck-chet.watson.ibm.com> (raw)
In-Reply-To: Your message of "Thu, 07 Dec 2000 09:31:46 +0100." <14895.19186.716809.936261@gargle.gargle.HOWL>



Hmm ... I'm not sure I believe this.  I worked a lot with SML/NJ, and
aside from using continuations to implement lightweight threading, and
using them to do backtracking, there were really no good uses for
them.

We can dispatch backtracking quite easily -- in modern main-line
business and scientific applications, naive use of backtracking (which
is all that call/cc really buys you) isn't really very useful.  It's
about as useful as constraint logic programming was to operations
research.  I'm talking about economic utility -- helping problems that
matter to somebody with either money, or lives, to save.

[It's not that logic-programming doesn't have its place -- certainly,
business-rule systems could benefit from a healthy dose of
logic-programming rigor -- but rather that naive application of
techniques from programming-language research almost always falls on
its sword.  It takes a pretty careful application of all this advanced
research, to "get it right".  Witness that out of all the
implementation of ML, only CAML-Light really is fast enough, small
enough, and portable enough, to be worth bothering with.  That's a
stunning failure rate, considering how many different ML
implementations there are out there.]

As for lightweight threading, well, it's nice that you can implement
them with continuations, but the real purpose of threading is to
interface with some external source of events.  Every such source
(except for the lowest-level X windows protocol) requires operating
system-level thread-contexts, so you'll end up needing heavyweight
threads anyway.

Finally, well, as Ousterhout noted in his seminal paper on events
vs. threads, there are rarely any good reasons to use threads, if you
have sufficient abstraction power (closures!) in your language.

So, well, no, I guess I don't really see how call/cc would be a good
thing to add to CAML, or, for that matter, to any language.

I can understand that it's very useful in academic languages, like
Scheme or SML/NJ.  But for languages that (perhaps also) aspire to
real-world use, and to solving problems posed from outside the world
of programming-language semantics, well, I greatly doubt that call/cc
is a good thing.

--chet--

>>>>> "SB" == STARYNKEVITCH Basile <Basile.Starynkevitch@cea.fr> writes:
>>>>> "Joe" == Joe Lisp <joelisp@yahoo.com> writes:

    Joe> Is anyone working on callcc for OCaml?

    SB> I am not working on it (although I would like to...)

    SB> However, adding explicit continuations to Ocaml is an
    SB> important task:



  parent reply	other threads:[~2000-12-11 17:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-06 20:13 Joe Lisp
2000-12-07  8:31 ` STARYNKEVITCH Basile
2000-12-09  3:58   ` eijiro_sumii
2000-12-09 18:48   ` Chet Murthy [this message]
2000-12-12 17:14     ` John Max Skaller
2000-12-08 10:50 ` Xavier Leroy
2000-12-13 13:44 Dave Berry
2000-12-13 16:36 ` Chet Murthy
2000-12-14 19:20   ` T. Kurt Bond
2000-12-15 13:31     ` Martin Berger
2000-12-15 18:37   ` Julian Assange
2000-12-15 23:10     ` Chet Murthy
2000-12-14 19:08 forsyth

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=200012091848.NAA01988@bismarck-chet.watson.ibm.com \
    --to=chet@watson.ibm.com \
    --cc=Basile.Starynkevitch@cea.fr \
    --cc=caml-list@inria.fr \
    --cc=joelisp@yahoo.com \
    /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;
as well as URLs for NNTP newsgroup(s).