[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Floating-point constant folding in Emacs byte compiler

From: Pip Cet
Subject: Re: Floating-point constant folding in Emacs byte compiler
Date: Mon, 2 Apr 2018 14:54:10 +0000

On Mon, Apr 2, 2018 at 1:37 PM, Drew Adams <address@hidden> wrote:
> Would it be possible for a user or Lisp code to be
> able to specify that it does not want the byte compiler
> to perform such floating-point optimization, in order
> to provide more platform-independence?

I think it's slightly different: I think it should be possible to
instruct the compiler, in special cases (when building byte code that
is to be run on several different machines/Emacs implementations), to
perform the optimizations, which result in code that is very slightly
more efficient and less platform-dependent (but might break certain
long-standing assumptions about independently constructed floats never
being eq). It's the unoptimized code that makes it easy to rely on
platform-dependent features, and that depends on implementation
details in ways that the optimized code does not.

> Many uses of Emacs Lisp and C code don't really need
> such optimization, I would think.  Couldn't the byte
> compiler be made to respect a user (or Lisp-code)
> choice here?

If I understand Eli correctly, there's no way to enable the new option
by default, because old code might break in subtle ways; that also
makes it questionable whether it's worth it to include the new option
at all.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]