Python 2.0

Tim Peters tim_one at email.msn.com
Wed Jun 2 00:53:40 EDT 1999


[Raymond G. Beausoleil]
> Although I have not followed the recent evolution of Java very
> carefully, I have strong misgivings about the compromises made in
> the numerical core of Java. For  details, I recommend a quick
> review of William Kahan's presentation on this topic:

Make that Welvel Kahan, or W. Kahan as he seems to prefer.

> http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf
>
> I'm new to Python, but I'm very excited about NumPy and PIL,
> and I wonder what compromises would have to made to these extensions
> if Python were rewritten in Java?

None, actually -- Python has no IEEE-754 story at all to tell today,
inheriting whatever random stuff the platform's C delivers, and having a
design in some areas that precludes 754 conformance (e.g., x == x is always
true in Python, and by design).  Java's rules are actually closer to 754
conformance than most popular languages'.

[Peter Koren]
> Has Sun done anything about Kahan's objections? This is indeed a serious
> matter.

If you read to the end of the paper, you'll find

    Java’s floating-point suffers from serious oversights. The same could
    be said of several other programming languages,

Ahem -- try replacing "several" with "virtually all" <0.1 wink>.

    some of them venerable, but Java lacks their historical excuses.

Recognize the polemic for what it is.  Java is likely much closer to
mandating substantial 754 conformance that whatever language you're using
today!

> A huge percentage of the statistically based studies prior to
> the works of Wilkinson and later, Lawson and Hanson, was garbage,
> because of poor numerics. This is a show stopper issue for Java in
> science and engineering.

Java is a whale of a lot closer than Fortran or C++ -- or are the sci/eng
folks all programming Borneo now <wink>?

754 provides some wonderful tools for true experts that Java doesn't yet
expose, but no tweaking of finite floating-point arithmetic rules is going
to save anyone from a numerically naive algorithm.  Directed rounding modes
and signed zeroes et alia don't do you any good unless you know how to use
them and apply them with extreme care -- and very few people do or can.  For
the rest, Java mandates IEEE nearest/even results, which is likely more than
what they're guaranteed today.

> If Java does not change, it should be rejected. Too bad. I am a Linux
> junkie and would love to see a reformed Java win and Microsoft lose.

MS has seemed to move away from the 754 spirit in its language
implementations rather than closer to it.  So if full access to all 754
features is what drives the market, MS will surely die within a few short
years <breath-holding wink>.

> I too am thrilled by NumPy, PIL and the other scientific packages that
> Hugunin, Hinsen, and Andrich have cooked up and/or packaged. The user
> community is as important as the language and Python is rich in both
> respects.

Yes it is!  But if Java's 754 story is a disaster, we'll need a new word for
Python's.

754-is-a-hw-std-that-almost-all-sw-still-ignores-ly y'rs  - tim






More information about the Python-list mailing list