unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Gemini Lasswell <gazally@runbox.com>,
	Noam Postavsky <npostavs@gmail.com>,
	bug-gnu-emacs
	<bug-gnu-emacs-bounces+psainty=orcon.net.nz@gnu.org>,
	31688@debbugs.gnu.org
Subject: bug#31688: 26.1.50; Byte compiler confuses two string variables
Date: Mon, 04 Jun 2018 22:02:27 +1200	[thread overview]
Message-ID: <2a9f684c2867ae9a7deccb51d04f9de6@webmail.orcon.net.nz> (raw)
In-Reply-To: <87y3fw9g18.fsf@igel.home>

On 2018-06-04 01:05, Andreas Schwab wrote:
> On Jun 04 2018, Phil Sainty <psainty@orcon.net.nz> wrote:
>> I generally dislike it when byte-compiled and interpreted code
>> give different results.
> 
> This really has nothing to do with byte-compilation.  Whether
> literals are shared or not should not be relied upon.  You always
> have to be careful when modifying values in-place.

I don't disagree that one ought to take care when modifying values
in-place, but my general concern is purely that the byte-compiler is
producing code which does not behave the same as the uncompiled code.
(i.e. I think my issue is specifically to do with byte-compilation,
and I would consider such discrepancies to be a problem irrespective
of the sort of code which was affected.)

Surely consistent behaviour between compiled and uncompiled code is
not only desirable, but a primary goal?

I realise (albeit vaguely) that the byte code and its interpreter are
rather different to the uncompiled versions, so I suppose this may not
be the only situation where a discrepancy results; but I think that
known cases ought be identified and documented (and I think that
eliminating such differences may be a valuable improvement).

The "(elisp)Byte Compilation" info node could certainly do with a
child node detailing the ways in which byte-compiled code behaves
differently from uncompiled code, so that elisp authors can gain an
understanding of all these nuances from a single section of the
manual.


> Whether literals are shared or not should not be relied upon.

Why?

I mean, in this case we already know the answer, but why shouldn't the
behaviour be consistent and dependable between the two variants?

Again, it bothers me to think that someone could observe a bug when
running byte-compiled code, and try to debug it but, through the
process of instrumenting functions for debugging, unwittingly change
the behaviour of the code such that the bug no longer occurs.


-Phil






  reply	other threads:[~2018-06-04 10:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 17:51 bug#31688: 26.1.50; Byte compiler confuses two string variables Gemini Lasswell
2018-06-02 18:02 ` Noam Postavsky
2018-06-02 22:52   ` Gemini Lasswell
2018-06-02 23:25     ` Noam Postavsky
2018-06-03  0:40     ` Drew Adams
2018-06-02 23:03   ` Drew Adams
2018-06-02 23:38   ` Phil Sainty
2018-06-02 23:54     ` Noam Postavsky
2018-06-03 12:32       ` Phil Sainty
2018-06-03 13:05         ` Andreas Schwab
2018-06-04 10:02           ` Phil Sainty [this message]
2018-06-04 15:58             ` Eli Zaretskii
2018-06-04 17:01             ` Andreas Schwab
2018-06-08 15:09               ` Eli Zaretskii
2018-06-03  0:02     ` Michael Heerdegen
2018-06-03  0:46       ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a9f684c2867ae9a7deccb51d04f9de6@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=31688@debbugs.gnu.org \
    --cc=bug-gnu-emacs-bounces+psainty=orcon.net.nz@gnu.org \
    --cc=gazally@runbox.com \
    --cc=npostavs@gmail.com \
    --cc=schwab@linux-m68k.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 public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).