Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pierre Weis <Pierre.Weis@inria.fr>
To: kwang@ropas.kaist.ac.kr (Kwangkeun Yi)
Cc: caml-list@inria.fr
Subject: Re: Question on language design (keywords vs Pervasives)
Date: Tue, 22 Aug 2000 10:31:27 +0200 (MET DST)	[thread overview]
Message-ID: <200008220831.KAA10895@pauillac.inria.fr> (raw)
In-Reply-To: <200008220038.JAA10162@ropas.kaist.ac.kr> from Kwangkeun Yi at "Aug 22, 100 09:38:05 am"

> > I'm sure that there is no ``more primitive function'' than raise to
> > raise an exception. So sorry, you cannot define raise ``in terms of a
> > more primitive function'' in Caml. You would need a language with
> > call/cc to express that, and Caml is not this language.
> 
> To make it precise, we don't even need call/cc. 
> Just a kind of cps transformation that carries two continuations (one
> for normal continuation and the other for handler continuation)
> removes all the raise/try expressions. The transformation is
> well-known. See 
> 
> @InProceedings{KiYiDa98,
>   author =       "Jung-taek Kim and Kwangkeun Yi and Olivier Danvy",
>   title =        "Assessing the Overhead of ML Exceptions by Selective
>                   CPS Transformation",
>   pages =     "103-114",
>   booktitle = "The Proceedings of the ACM SIGPLAN Workshop on ML",
>   year =      1998,
>   url = "http://ropas.kaist.ac.kr/~kwang/paper/98-ml-kiyida.ps.gz",
>   month =     sep
> }
> 
> -Kwang
> 
> --
> Kwangkeun Yi		http://cs.kaist.ac.kr/~kwang

The problem was not to remove try/raise expressions from programs, but
to define raise in terms of ``more primitive functions''. I'm not sure
a cps transformation can be considered as ``a primitive function'' of
the language that can help to define raise into the language.

I'm sure you can use a lot of other transformations to remove
try/raise, e.g. a monadic transformation or a direct expression of the
semantics of exceptions (using a direct sum of normal and exceptional
results) could also do the job.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/




      parent reply	other threads:[~2000-08-22  8:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-18  2:07 Fermin Reig
2000-08-19 16:57 ` Frank Atanassow
2000-08-20 19:01 ` Pierre Weis
2000-08-20 19:55   ` John Prevost
2000-08-21  8:58     ` Pierre Weis
2000-08-21 19:47       ` John Prevost
2000-08-21 21:41         ` Pierre Weis
2000-08-21 16:44   ` John Max Skaller
2000-08-21 21:24     ` Pierre Weis
2000-08-22  0:38       ` Kwangkeun Yi
2000-08-22  2:25         ` John Max Skaller
2000-08-22  9:08           ` Pierre Weis
2000-08-22  8:31         ` Pierre Weis [this message]

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=200008220831.KAA10895@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=kwang@ropas.kaist.ac.kr \
    /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