all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Intervals crash
Date: Mon, 27 Sep 2010 08:55:25 +0200	[thread overview]
Message-ID: <87fwwvd6aq.fsf@lola.goethe.zz> (raw)
In-Reply-To: 87y6aneqhs.fsf@uwakimon.sk.tsukuba.ac.jp

"Stephen J. Turnbull" <stephen@xemacs.org> writes:

> Miles Bader writes:
>
>  > "unsigned good or evil" is such a hoary old religious issue that
>  > any unasked-for advocacy is likely to get you lumped in with the
>  > freaks, simply out of habit on the part of the listener...
>
> OK.  Nevertheless, I find it strange that the *bare fact* that
> removing unsigned thoroughly has saved XEmacs users many crashes can
> pass without comment (as it has, four times now).

Since few people except yourself here have experience with XEmacs, there
is not much to comment on.  That does not mean that your report went
unnoticed.  What kind of reply would you want?  "That's not relevant
since Emacs programmers are smarter than XEmacs programmers" and then
you try countering that?  A bit hard to pull off given that this thread
is about problems with EMACS_UINT in Emacs.

Personally, I was surprised that we have EMACS_UINT at all since Emacs
integers are, after all, signed, and I would not have much confidence in
applications that tried squeezing that bit out for unsigned operations.
When programming in assembly language, you have the respective
operations and status bits and conditions to pull mixed signedness
operations reasonably well.  In C, and operations have a fixed sign
interpretation for both operands and you don't get access to the
combination of carry and overflow status bits that are needed as
transitory extra precision for sorting out the ugly cases.

When you don't desperately need that extra bit of unsignedness, it is
rarely worth getting.  It's been somewhat sobering to when first
programming with the 68000 (the C compilers started out with 16bit ints)
that using _unsigned_ array index variables bloated the code and slowed
it down.  The indexed addressing modes only knew how to deal with signed
offsets.

In fact, basically any modern CPU can deal better with sign extension
(in particular in addressing modes) than with, uh, unsign extension.  So
unless you definitely need that extra bit, unsigned is not worth the
trouble.

For EMACS_UINT, we can safely say we don't need that extra bit since
Emacs integers are signed (and smaller in total size) to begin with.

Now that's not at all a comment on your practical experiences (like you
desired and will not likely get).  This is just another theoretic
rambling.

-- 
David Kastrup




  reply	other threads:[~2010-09-27  6:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 18:23 Intervals crash Chong Yidong
2010-09-23 18:52 ` Chong Yidong
2010-09-23 19:01   ` Eli Zaretskii
2010-09-23 19:09     ` Chong Yidong
2010-09-23 19:32       ` Eli Zaretskii
2010-09-23 18:57 ` Eli Zaretskii
2010-09-24  6:12   ` Stephen J. Turnbull
2010-09-24  8:16     ` Eli Zaretskii
2010-09-24  8:52       ` Stephen J. Turnbull
2010-09-24 10:03         ` Eli Zaretskii
2010-09-25 14:34           ` Stephen J. Turnbull
2010-09-25 16:10             ` Eli Zaretskii
2010-09-25 18:54               ` Stephen J. Turnbull
2010-09-25 22:07                 ` Eli Zaretskii
2010-09-26 13:08                   ` Stephen J. Turnbull
2010-09-26 19:22                     ` Miles Bader
2010-09-26 19:33                       ` David Kastrup
2010-09-27  4:53                       ` Stephen J. Turnbull
2010-09-27  6:55                         ` David Kastrup [this message]
2010-09-27  7:42                           ` Jan Djärv
2010-09-27  8:34                             ` Eli Zaretskii
2010-09-27  9:02                               ` David Kastrup
2010-09-27 11:02                                 ` Eli Zaretskii
2010-09-27  8:36                           ` Eli Zaretskii
2010-09-27  8:50                           ` Stephen J. Turnbull
2010-09-27  9:39                             ` David Kastrup
2010-09-27  9:45                               ` Lars Magne Ingebrigtsen
2010-09-27 10:11                               ` Stephen J. Turnbull
2010-09-24 10:31 ` Eli Zaretskii

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=87fwwvd6aq.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --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.