Subject: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function

From: Mattias Engdegård <[email-masked]>
Date: Fri, 4 Aug 2023 15:41:17 +0200

4 aug. 2023 kl. 13.11 skrev Alan Mackenzie <[email-masked]>:

> Using a hash table, or something similar?  This is all very well, but the
> garbage collecter, for every collected object, would have to check
> whether that object is in that table, and if so remove it.  This would
> slow down garbage collection, possibly by a lot.

The table could have weak keys, and there are known GC algorithms for dealing with those.
It doesn't actually need to be a hash table at all -- we only need to optimise for fast insertion and small size, not lookup (for displaying compiler diagnostics, for example).

This is a very half-baked idea; I haven't thought it through at all. For example, we may need a way to transfer location from one sexp to a newly built one, and that may complicate the inner workings of the compiler (or not).

It's clear that symbols-with-pos is a neat hack that is surprisingly effective, with almost no changes to Lisp code needed at all. It definitely has improved diagnostics. Unfortunately it makes everything a bit slower, not just the compiler, but symbols-with-pos will serve until we come up with something better.