all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Proposal: stack traces with line numbers
Date: Tue, 17 Oct 2017 02:00:14 +0200	[thread overview]
Message-ID: <m2y3oak5ip.fsf@caladan> (raw)
In-Reply-To: CAEdRJLBZ5QaJF+b05GdBrZK80ijQcaHW+FSAps0ME0iQ+5qhBA@mail.gmail.com

On Mon, Oct 16 2017, John Williams wrote:

> What I had in mind was a single global hashtable, because that way
> it's easy to make it look as if the source refs are physically part of
> the annotated cons cells, and users of the API don't need to be aware
> that a supplementary data structure even exists. But of course using a
> global hashtable with strong keys would create a huge space leak in
> the reader.
>
> Is there any particular disadvantage to using weak keys?

The question is probably more if a global hashtable is a good idea.

I think an interface to read, like

(let* ((read-with-symbol-positions t)
       (read-symbol-positions-list '())
       (read-cons-position-table (make-hash-table :key 'eq))
       (form (read ...))
    ... do stuff with form ...)

would be fairly clean. Actually, it's quite hard to imagine a different
solution :-).  So users of read will probably have the choice anyway
whether to bind read-cons-position-table (or whatever the name will be)
to a fresh hashtable or reuse a global table.

> The file name would be a single string object shared by every ref in a
> given file (or nil when there is no file), so we'd only be saving a
> few words per source ref (one for the string itself, plus one or two
> saved by using a cons cell instead of a two-element vector.)

For the interface to read (the macro expander/compiler is a different
story) I would only record character positions.  Certainly easier to
handle for the garbage collector than a vector.  But it's not my call to
make.

Helmut




  reply	other threads:[~2017-10-17  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-15  0:17 Proposal: stack traces with line numbers John Williams
2017-10-15  1:54 ` Daniele Nicolodi
2017-10-15  2:42 ` raman
2017-10-15  3:20   ` Noam Postavsky
2017-10-15  3:40 ` Robert Weiner
2017-10-15 10:01 ` Helmut Eller
2017-10-15 16:20   ` Stefan Monnier
2017-10-16 22:43   ` John Williams
2017-10-17  0:00     ` Helmut Eller [this message]
2017-10-18 15:00     ` John Williams
2017-10-16  1:53 ` Richard Stallman
2017-10-16 21:51 ` Wilfred Hughes

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=m2y3oak5ip.fsf@caladan \
    --to=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.