LWN: Comments on "CPython, C standards, and IEEE 754" https://lwn.net/Articles/886516/ This is a special feed containing comments posted to the individual LWN article titled "CPython, C standards, and IEEE 754". en-us Tue, 23 Sep 2025 01:26:34 +0000 Tue, 23 Sep 2025 01:26:34 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net CPython, C standards, and IEEE 754 https://lwn.net/Articles/887392/ https://lwn.net/Articles/887392/ bartoc <div class="FormattedComment"> C11 anon union support has been supported for a long time via &quot;ms-extensions&quot; on all three major compilers. That flag turns on just the ms-extensions that were probably good ideas in hindsight, not the really horrible ones. There&#x27;s a gcc only variant called plan9-extensions that&#x27;s even cooler, and you can absolutely see the seeds of some Go features in that extension.<br> <p> Sidenote: while msvc is pretty unlikely to ever support them I actually don&#x27;t think VLAs are that horrible of a feature. Compilers just have to emit stack probes! which they were all really bad about doing initially (and some even still don&#x27;t with default settings!). IMO the standard should have required them to emit them unconditionally (unless the compiler can prove the size is actually &lt; 1 page, for sure). I should write a paper, tbh.<br> </div> Wed, 09 Mar 2022 23:52:13 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886913/ https://lwn.net/Articles/886913/ wtarreau <div class="FormattedComment"> If I were certain it wouldn&#x27;t take gigs of disk and hundreds of megs of RAM, I&#x27;d try on my old VAX with its 12 MB RAM just to see :-) But most likely gcc-2.95 will not build recent versions anyway.<br> </div> Sat, 05 Mar 2022 17:46:58 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886652/ https://lwn.net/Articles/886652/ ballombe <div class="FormattedComment"> Note that there is a difference between hardware ieee754 support and software ieee754 support.<br> There are ARM processors without hardware ieee754, but with software ieee754 support, but of course the performance are not the same.<br> Even VAX could in theory have software ieee754 support.<br> </div> Thu, 03 Mar 2022 11:28:38 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886650/ https://lwn.net/Articles/886650/ NYKevin <div class="FormattedComment"> The argument is, essentially, because that&#x27;s how C works. C does not specify how floats behave, but every reasonable implementation on the planet follows IEEE 754 unless you pass a flag such as -ffast-math (or it&#x27;s running on a VAX or something). Technically, if you try to compile CPython with -ffast-math, it&#x27;ll probably produce an entirely functional binary, but the resulting Python interpreter might not strictly follow IEEE 754, depending on what optimizations the C compiler was able to make. But that&#x27;s a nonstarter if you want to *officially* support non-754 floats in CPython, because -ffast-math does not (strictly) obey any standard whatsoever, so there&#x27;s nothing you can reasonably test it against (i.e. you can&#x27;t make a -ffast-math test suite as you can for IEEE 754). All you can really do is put a line in the documentation saying &quot;here there be dragons.&quot;<br> </div> Thu, 03 Mar 2022 09:42:16 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886648/ https://lwn.net/Articles/886648/ taladar <div class="FormattedComment"> Why not? If all hardware out there today supports IEEE 754 (something that can be said for standards on very few other topics) what does Python gain from keeping their own language standard ambiguous on this matter?<br> </div> Thu, 03 Mar 2022 09:26:47 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886636/ https://lwn.net/Articles/886636/ developer122 <div class="FormattedComment"> I&#x27;m talking in practical terms. There is no implementation of python today (at least among the ones tested) that will compile and run on a VAX.<br> </div> Thu, 03 Mar 2022 05:24:44 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886624/ https://lwn.net/Articles/886624/ NYKevin <div class="FormattedComment"> It is certainly impossible to build CPython without IEEE 754, as described in the article, but Python is the language, not the implementation. The article is (basically) saying that, if someone really wants to go to the obscene lengths required to completely re-implement Python from scratch in a no-floats environment, the language spec should not explicitly forbid such a thing. OTOH, nobody ever promised that was going to be *easy.*<br> </div> Thu, 03 Mar 2022 02:42:56 +0000 CPython, C standards, and IEEE 754 https://lwn.net/Articles/886617/ https://lwn.net/Articles/886617/ developer122 <div class="FormattedComment"> In practical terms, I don&#x27;t think it&#x27;s possible to build python without IEEE 754 anyway. Someone tried it on a VAX a few years ago, and even though they were willing to wait months for it to compile the total lack of IEEE 754 made it completely impossible. It was stated that the only way this was going to work was if someone implemented software-emulated IEEE 754 for the VAX architecture and then ported python/the compiler to use it.<br> </div> Wed, 02 Mar 2022 23:52:06 +0000