Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: echinuz echinuz <echinuz@yahoo.com>
To: caml-list@inria.fr
Subject: How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations
Date: Fri, 14 Dec 2007 13:22:23 -0800 (PST)	[thread overview]
Message-ID: <606064.60999.qm@web60114.mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

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?
 
       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[-- Attachment #2: Type: text/html, Size: 1559 bytes --]

             reply	other threads:[~2007-12-14 21:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 21:22 echinuz echinuz [this message]
2007-12-15 15:47 ` [Caml-list] " Nicolas Pouillard
2007-12-15 19:32   ` 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=606064.60999.qm@web60114.mail.yahoo.com \
    --to=echinuz@yahoo.com \
    --cc=caml-list@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