emacs-devel
[Top][All Lists]
Advanced

[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, 26 Mar 2018 18:23:15 +0000

Well, right now the byte code (or at least the constant vector) does
depend on the machine on which the code was byte-compiled, but it's
also read differently: if I understand things correctly, large
integers in decimal notation are automatically converted to floats,
while large hex constants signal an overflow error. I believe the
former case applies to the read syntax for byte-compiled functions.

But is this really a problem for any actual code? Good code shouldn't
depend on more than the 30 bits Emacs guarantees, and IMHO it
shouldn't distinguish between integers and their floating-point
representations. In other words, I think we should specify less
behavior for our numbers, not more, and keep the byte compiler simple.
If code is broken for any of 30-bit integers, 62-bit integers, 32-bit
integers, 48-bit integers, integers-as-IEEE-doubles, or bignums, or
any combination of two of those for compilation and reading/running
bytecode, that's a bug which makes it harder to play around with Emacs
internals.



reply via email to

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