caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <Anil@recoil.org>
To: Wojciech Meyer <wojciech.meyer@googlemail.com>
Cc: Gabriel Scherer <gabriel.scherer@gmail.com>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] working %.pp.ml target with ocamfind/ocamlbuild
Date: Thu, 20 Sep 2012 22:04:31 +0100	[thread overview]
Message-ID: <20120920210431.GI22767@dark.recoil.org> (raw)
In-Reply-To: <wfmx0zupku.fsf@gmail.com>

On Sun, Sep 09, 2012 at 05:29:53PM +0100, Wojciech Meyer wrote:
> Gabriel Scherer <gabriel.scherer@gmail.com> writes:
> 
> > This is useful for debugging purposes, and for some (minor) modes of
> > use of Camlp4. However, for most Camlp4 development, this has the
> > severe downside of losing the location information of the original
> > file, if I understand correctly. This means that you don't want to use
> > it as a transparent step towards compilation, but only in exceptional
> > situations where the developers will re-edit the output code.
> 
> I think I've to say I disagree it's not useful, when I'm developing a
> syntax extension on top of Camlp4 I really want to see the generated
> code. Moreover to understand some of the more complicated syntax
> extensions like type_conv, deriving, FoldGenerator I need to look at the
> expanded code to understand how to use it - last time I hit the same
> problem it was actually 'deriving-ocsigen' when I needed to implement my
> own Show module - it's just much faster to see what's being generated
> for the usual case, then trying to figure out from the recipe in the
> documentation.  Otherwise for bootstrapping purposes, you might want to
> pre-generate some code too and put into the repository.

The %.pp.ml rule is really essential for day-to-day development too.
Since camlp4 cannot generate ocamldoc comments, it's often easier to just
dump the .pp.ml output and inspect the code directly, rather than root
around figuring out what the code generator modules are doing.

This is less of an issue with well-established extensions such as sexplib,
but useful when learning new ones such as the Lwt one (which has some odd
corner cases such as the >> bind precedence).

-- 
Anil Madhavapeddy                                 http://anil.recoil.org

      parent reply	other threads:[~2012-09-20 21:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 23:19 Anil Madhavapeddy
2011-12-31  9:22 ` Gabriel Scherer
2012-09-09 16:29   ` Wojciech Meyer
2012-09-10 12:08     ` [Caml-list] " Hongbo Zhang
2012-09-10 12:18       ` bob zhang
2012-09-10 13:04         ` Wojciech Meyer
2012-09-11 12:27         ` AW: " Gerd Stolpmann
2012-09-11 12:50           ` Wojciech Meyer
2012-09-11 13:41             ` AW: " Gerd Stolpmann
     [not found]             ` <1347370879.3496.9@samsung>
2012-09-11 14:02               ` Wojciech Meyer
2012-09-11 20:24           ` [Caml-list] Re: AW: " Hongbo Zhang
2012-09-11 23:13             ` [Caml-list] " Gerd Stolpmann
2012-09-12  5:16               ` Hongbo Zhang
2012-09-10 12:55       ` Wojciech Meyer
2012-09-10 13:52         ` Alain Frisch
2012-09-10 14:36           ` Paolo Donadeo
2012-09-18  6:08             ` [Caml-list] Slides of ML workshop (was: working %.pp.ml target with ocamfind/ocamlbuild) Alain Frisch
2012-09-20 21:04     ` Anil Madhavapeddy [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=20120920210431.GI22767@dark.recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    --cc=wojciech.meyer@googlemail.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).