Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations
@ 2007-12-14 21:22 echinuz echinuz
  2007-12-15 15:47 ` [Caml-list] " Nicolas Pouillard
  2007-12-15 16:54 ` Daniel de Rauglaudre
  0 siblings, 2 replies; 12+ messages in thread
From: echinuz echinuz @ 2007-12-14 21:22 UTC (permalink / raw)
  To: caml-list

[-- 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 --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-12-19  9:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14 21:22 How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations echinuz echinuz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox