Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: echinuz echinuz <echinuz@yahoo.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations
Date: Sat, 15 Dec 2007 16:47:40 +0100	[thread overview]
Message-ID: <1197733590-sup-3933@ausone.local> (raw)
In-Reply-To: <606064.60999.qm@web60114.mail.yahoo.com>

Note: Camlp4 give you locations relative to the entire program ;)

Regards,

Excerpts from echinuz echinuz's message of Fri Dec 14 22:22:23 +0100 2007:
> I have a DSL that I embedded using quotations with camlp5.  Essentially, there
> are a number of features that are useful in ocaml, such as file io, that I
> don't want to add to the language.  Using quotations allows me to add these
> features.  The language, by itself, can be statically type checked, but since I
> allow antiquotations I must type check at runtime.  Unfortunately, I'm having
> trouble figuring out a sensible way to add debugging information during type
> checking.  A typical program looks like this:
> 
> let x=... in
> let prog= <:prog<
>      embedded commands...
>      more embedded commands...
> >> in
> execute prog;;
> 
> The problem with location information generated in camlp5 is that it gives the
> location relative to the quote.  I'm more interested in location information
> relative to the entire program.  One thought is to run the file through camlp5
> twice and generate location information using trick similar to __LOCATION__
> from pa_macro.  However, since the first pass through expands the quotations,
> the subsequent location information tends to be deceptive.
> 
> Is there a good way to generate this location information?  Or, more generally,
> is there a better way to type check the resulting program?
>  

-- 
Nicolas Pouillard aka Ertai


  reply	other threads:[~2007-12-15 15:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 21:22 echinuz echinuz
2007-12-15 15:47 ` Nicolas Pouillard [this message]
2007-12-15 19:32   ` [Caml-list] " echinuz echinuz
2007-12-16 16:50     ` Daniel de Rauglaudre
2007-12-17 10:54     ` Nicolas Pouillard
2007-12-17  3:29   ` echinuz echinuz
2007-12-17  5:28     ` Daniel de Rauglaudre
2007-12-17  9:11   ` echinuz echinuz
2007-12-17 12:41     ` Daniel de Rauglaudre
2007-12-18 23:05   ` echinuz echinuz
2007-12-19  9:50     ` Daniel de Rauglaudre
2007-12-15 16:54 ` Daniel de Rauglaudre

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=1197733590-sup-3933@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=echinuz@yahoo.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