caml-list - the Caml user's mailing list
 help / Atom feed
From: Basile Starynkevitch <basile@starynkevitch.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Introspection of functions with Utop
Date: Sat, 25 Apr 2020 15:37:10 +0200
Message-ID: <ed42fc15-8eb5-5143-9c48-f975de076b44@starynkevitch.net> (raw)
In-Reply-To: <87eesbiu91.fsf@m4x.org>

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


On 4/25/20 3:12 PM, Alan Schmitt wrote:
> On 2020-04-25 08:43, Malcolm Matalka <mmatalka@gmail.com> writes:
>
>> What's the answer??
> There is no way to print the code of the function. It is compiled to
> bytecode by the toplevel and added to the current environment.


Unless (on Linux/x86-64 at least) you compile the code with the -g 
debugging option.


Adventurous developers could even couple that with Ian Taylor's 
libbacktrace library. I leave them to check license compatibility with 
their lawyers.

https://github.com/ianlancetaylor/libbacktrace

The real issue is of course funding, as usual. DWARF support in Ocaml 
needs improvement.

https://en.wikipedia.org/wiki/DWARF


> -- 

Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France; <basile@starynkevitch.net>
(mobile phone: cf my web page / voir ma page web...)


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

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 11:41 orbifx
2020-04-21 14:09 ` Ali M.
2020-04-24 16:05   ` orbifx
2020-04-25  6:43     ` Malcolm Matalka
2020-04-25 13:20       ` Alan Schmitt
2020-04-25 13:37         ` Basile Starynkevitch [this message]
2020-04-27 16:12           ` Josh Berdine

Reply instructions:

You may reply publically 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=ed42fc15-8eb5-5143-9c48-f975de076b44@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --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

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox