From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ask for a more efficient way to deallocate memory (full version)
Date: Sun, 16 Dec 2007 15:14:24 +0000 [thread overview]
Message-ID: <200712161514.25301.jon@ffconsultancy.com> (raw)
In-Reply-To: <1197754414.4764482e09e3f@webmail.in-berlin.de>
On Saturday 15 December 2007 21:33, Oliver Bandel wrote:
> Zitat von Jon Harrop <jon@ffconsultancy.com>:
> > So Martin's code adds a
> > new
> > syntactic construct and automatically injects the code for the
> > compiler that
> > we must currently write by hand. Consequently, its performance will
> > be
> > superb: as good as hand-written OCaml code.
>
> So, is it just a kind of pre-compilation?
You could say that, yes. It is pre-compiling code written in your own syntax
into ordinary OCaml code.
> The core-OCaml compiler will be the same?
Yes.
> Is the TryFinally-code slight enough, so that
> it's behaving like handwritten OCaml?
Exactly, yes. If you're worried about performance then there are cases where
you can actually use camlp4 macros to improve performance.
> Did you look at the TryFinally in detail?
The article I wrote for the OCaml Journal actually walks through the creation
of a camlp4 macro that augments OCaml's syntax with a try..finally construct.
> > However, using any camlp4 macros requires using the camlp4
> > replacement for the
> > front-end of the compiler.
>
> I have not looked at the OCaml-compiler in detail,
> but from what you wrote I would assume, there
> are at least two parts.
You don't really see that there are two parts to the compiler. The only thing
that intrudes on the programmer (besides different error messages) is the new
compilation line.
> I had not needed camlp4 so far. And I don't know if it makes sense to
> look at it now, because there will be (or already is?) a replacement
> (from 3.10 on?).
I've only been talking about the new implementation in OCaml 3.10 and beyond.
There was a previous implementation as well (now renamed camlp5).
> I hope the camlp4-tutorial will be updated to the camlp4-replacement.
> Possibly later I might use it. Then it would be good to have
> introductional material.
Yes. There is certainly a shortage of information on this subject. Eventually
the camlp5 will be phased out but I can't see that happening until its new
replacement camlp4 is properly documented.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
next prev parent reply other threads:[~2007-12-16 15:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-09 21:39 Fabrice.Pardo
2007-12-09 21:55 ` [Caml-list] " Olivier Andrieu
2007-12-10 11:25 ` Fabrice Pardo
2007-12-10 12:03 ` Michaël Le Barbier
2007-12-10 16:33 ` Oliver Bandel
2007-12-10 20:27 ` Richard Jones
2007-12-10 21:05 ` Oliver Bandel
2007-12-10 21:15 ` Gordon Henriksen
2007-12-10 22:13 ` Oliver Bandel
2007-12-10 22:59 ` Jon Harrop
2007-12-10 23:29 ` Jon Harrop
2007-12-11 2:03 ` Yitzhak Mandelbaum
2007-12-15 21:33 ` Oliver Bandel
2007-12-16 15:14 ` Jon Harrop [this message]
2007-12-10 23:24 ` Jon Harrop
2007-12-09 21:57 ` Oliver Bandel
2007-12-09 22:12 ` Jon Harrop
2007-12-09 22:34 ` Oliver Bandel
2007-12-09 22:16 ` Oliver Bandel
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=200712161514.25301.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.inria.fr \
/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