caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: oleg@pobox.com
Cc: psnively@mac.com, caml-list@inria.fr
Subject: Re: [Caml-list] Incremental, undoable parsing in OCaml as the
Date: Fri, 06 Jul 2007 14:40:24 +1000	[thread overview]
Message-ID: <1183696824.29802.51.camel@rosella.wigram> (raw)
In-Reply-To: <20070705230000.10763AD43@Adric.metnet.fnmoc.navy.mil>

On Thu, 2007-07-05 at 16:00 -0700, oleg@pobox.com wrote:
> The claim of *mechanical*, automatic and universal inversion of
> existing, unmodified, separately compiled parsers, etc. stands.
> 
> I believe we have a mis-understanding.

Probably.

>  There are TWO implementations
> of delimited continuations for OCaml. One is the monadic, implemented
> in pure 100% OCaml and available for both bytecode and native
> compilers. The other is non-monadic implementation, which is at
> present available for byte-code only. Paul Snively asked we about the
> first, monadic one. To use that implementation, one indeed has to
> re-write the parser and everything else for that matter in monadic
> style.

So we agree, the monadic implementation requires a rewrite.

> The original message was talking about the non-monadic, direct style
> approach. There, the inversion of the parser works automatically and
> mechanically. There is no need to re-write the parser or anything
> else.

Obviously you have rewrite the interfaces.. :)

But yes, this seems to be the source of confusion. A bytecode
version is not only feasible .. Ocaml's vmthreads have already
provided control inversion for years -- but only for blocking
I/O operations.

Native code control inversion is not so easy. In absence of
foreign code (C code or whatever) it can probably be done
most easily by patching Ocaml native code generators so
they stop using the stack and use a heap based spaghetti stack
instead.

Inversion by copying or switching stacks in a more general
context isn't possible, unfortunately. By 'more general'
I mean in the presence of arbitrary foreign code 'up stack'.

For example, you can't expect C++ callbacks which throw
exceptions to work if you fiddle the stack. I think Hans
Boehm has the most data on this, since to implement his
conservative collector he needs to know where just about
everything is on a wide class of platforms.

[However Felix compiler is 100% pure ocaml.. ]


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-07-06  4:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-03 11:38 Incremental, undoable parsing in OCaml as the general parser inversion oleg
2007-07-03 15:28 ` [Caml-list] " skaller
2007-07-04 19:41 ` Paul Snively
2007-07-04 23:42   ` Paul Snively
2007-07-05  8:13     ` oleg
2007-07-05 12:39       ` skaller
2007-07-05 23:00         ` [Caml-list] Incremental, undoable parsing in OCaml as the oleg
2007-07-06  4:40           ` skaller [this message]
2007-07-05 13:23       ` [Caml-list] Incremental, undoable parsing in OCaml as the general parser inversion skaller
2007-07-05 13:54       ` Paul Snively

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=1183696824.29802.51.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=oleg@pobox.com \
    --cc=psnively@mac.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).