From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS,HTML_10_20,HTML_MESSAGE autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 75624BC6B for ; Fri, 14 Dec 2007 22:22:30 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHuDYkfAXQInh2dsb2JhbACCco0RAQEBCAopmTk X-IronPort-AV: E=Sophos;i="4.24,169,1196636400"; d="scan'208";a="5223716" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 14 Dec 2007 22:22:25 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lBELMPMA015948 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 14 Dec 2007 22:22:25 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHuDYkfRSbJhn2dsb2JhbACCco0RAQEBAQcEBgkIGJk5 X-IronPort-AV: E=Sophos;i="4.24,169,1196636400"; d="scan'208";a="5663890" Received: from web60114.mail.yahoo.com ([209.73.178.97]) by mail1-smtp-roc.national.inria.fr with SMTP; 14 Dec 2007 22:22:24 +0100 Received: (qmail 62006 invoked by uid 60001); 14 Dec 2007 21:22:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=iymja+CZkJYOErBnjCAw8aE9/up+QGEPW0FQlF/4nHW1IQMdCln0vmI3obW46DN3DEJMVVu2ikRndZwbS2VXIOABucipsbLIzMR3xfT0dr0tPmQxpjjYYnvERCd1JEMe33k6cV5/7QX04m4h9rAs+8uG2Aw3Rv0QNuADMW9jEJo=; X-YMail-OSG: 782b0SIVM1kUlVRn6SkyxZPse_eHvigQ_2Br.a26aklnzayEvSRn9vVonPCXdREbv_EG1ymGg5m4S1geb5DldTyjf4X3FfHPwjvMNA-- Received: from [66.100.224.174] by web60114.mail.yahoo.com via HTTP; Fri, 14 Dec 2007 13:22:23 PST Date: Fri, 14 Dec 2007 13:22:23 -0800 (PST) From: echinuz echinuz Subject: How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1987668909-1197667343=:60999" Content-Transfer-Encoding: 8bit Message-ID: <606064.60999.qm@web60114.mail.yahoo.com> X-Miltered: at concorde with ID 4762F411.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 ocaml:01 statically:01 runtime:01 ocaml:01 statically:01 runtime:01 deceptive:98 deceptive:98 dynamically:01 typechecking:01 essentially:02 essentially:02 checking:02 --0-1987668909-1197667343=:60999 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1987668909-1197667343=:60999 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1987668909-1197667343=:60999--