caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <pierre.weis@inria.fr>
To: j.prevost@cs.cmu.edu (John Prevost)
Cc: alex@baretta.com, caml-list@inria.fr
Subject: Re: [Caml-list] Functional scanning facilities
Date: Fri, 12 Jul 2002 09:24:27 +0200 (MET DST)	[thread overview]
Message-ID: <200207120724.JAA17517@pauillac.inria.fr> (raw)
In-Reply-To: <86r8i93bti.fsf@laurelin.dementia.org> from John Prevost at "Jul 11, 102 10:43:53 pm"

> >>>>> "ab" == Alessandro Baretta <alex@baretta.com> writes:
> 
>     ab> How about something like the follwing--the idea coming from
>     ab> posts I read a while ago about CPS programming:
> 
> It works quite well.  Take a look at Lindig's O'Caml implementation of
> parser combinators at http://www.gaertner.de/~lindig/software/mylib.html
> 
> A more complete description of how these work (expressed monadically)
> is available in a paper by Hutton and Meijer at
> http://www.cs.nott.ac.uk/~gmh/monparsing.pdf
> 
> These techniques can be applied quite easily in O'Caml, although the
> way infix definitions work leads to some rather... interesting choices
> of symbols.
> 
> John.
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

Em, sorry to interrupt you: I'm a fan of combinators since decades (my
thesis was entitled something like ``compiling with combinators''), I
also do love lambda-calculus and monades that I consider extremely
elegant and powerful theoretical tools, but wait, wait, wait ...

Here, we want to design and implement a practical, compact, simple to
understand, and easy way to print and scan in the context of a
functional language with full-fledged imperative features (we are not
in a lazy context where monades are mandatory anyway).

In this favourable situation, I'm afraid no combinatorial approach can
compete with the readability and compactness of C-style formats. In
addition, from the user's point of view, the seamingly flat
first-order typing simplicity of Caml printf (and now scanf)
primitives will be extremely hard to beat. Let alone the strongly
symetrical status and overall treatment of scanf and printf that is so
wonderful in the actual implementation of the Objective Caml
library.

Note that I am so enthousiastic about the new Scanf module because
this problem of implementing a C-like scanf facility in Caml was a
background thread in my head for at least 5 years, before I found the
tricks that lead to the actual scanf implementation ...

Pierre Weis

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


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-07-12  7:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12  1:36 Alessandro Baretta
2002-07-12  2:43 ` John Prevost
2002-07-12  7:24   ` Pierre Weis [this message]
2002-07-12  7:55     ` Basile STARYNKEVITCH
2002-07-12  7:58     ` John Prevost
2002-07-12  8:25     ` Stefano Zacchiroli
2002-07-12 11:16       ` Pierre Weis

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=200207120724.JAA17517@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    --cc=j.prevost@cs.cmu.edu \
    /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).