caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] More precise line number directives?
Date: Thu, 24 Aug 2017 19:30:38 +0200	[thread overview]
Message-ID: <df82c739-1079-43b5-89e0-628e0dc0ff49@gmail.com> (raw)

Hi all,

I came across the following section of the documentation a few days ago:

> Line number directives
>
> Preprocessors that generate OCaml source code can insert line number
> directives in their output so that error messages produced by the
> compiler contain line numbers and file names referring to the source
> file before preprocessing, instead of after preprocessing. A line
> number directive is composed of a # (sharp sign), followed by a
> positive integer (the source line number), optionally followed by a
> character string (the source file name). Line number directives are
> treated as blanks during lexical analysis.

Has there been efforts or proposals in the past to support more precise annotations?  Something like source maps, for example (https://github.com/ryanseddon/source-map/wiki/Source-maps:-languages,-tools-and-other-info; specs at https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/).

Some background: multiple languages, including Coq and F*, use OCaml as an intermediate language.  Debugging extracted code (with ocamldebug or gdb) or looking at backtraces is unpleasant, because the generated OCaml code isn't always pretty.  It would be very nice to get backtraces pointing to the original code (and even nicer to be able to step through the original sources!).

Has a similar proposal been discussed before?  Would it be hard to implement?

Thanks!
Clément.

                 reply	other threads:[~2017-08-24 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=df82c739-1079-43b5-89e0-628e0dc0ff49@gmail.com \
    --to=cpitclaudel@gmail.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;
as well as URLs for NNTP newsgroup(s).