This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Scala @strictfp support?

1 reply
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

>>>>> "Jon" == Jon Pretty writes:

Jon> Doing a quick grep of the Scala source code, strictfp isn't used
Jon> (but the compiler is vaguely aware of it, for completeness,
Jon> presumably). I suspect the reason it's not supported is lack of
Jon> demand. Java got away without it until version 5, didn't it?

strictfp has been around for over 10 years -- since Java 1.2.
It's important to some scientific users.

Most users justifiably don't care, but if you're doing some kinds of
scientific computing, then exact reproducibility of floating point
results cross-platform is important. For example, in our simulation
tool NetLogo, we promise users that if they run their simulation with
the same random seed, they'll get the same results every time, no matter
what computer they're on. This ensures that published simulation
results can be reproduced. And that promise rests on Java's strictfp
promise.

It's also convenient for testing purposes (in any application domain)
not to have to worry about whether results can vary slightly from
machine to machine.

It would certainly be nice if Scala supported strictfp declarations (an
annotation instead of a keyword would be fine). I don't have any actual
simulation engine code in Scala right now, but when I do, I guess I'll
have to find a way to post-process the class files generated by scalac
in order to set the strictfp flag.

Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 3 days ago.
Re: Scala @strictfp support?
You should file a ticket for this on Trac http://lampsvn.epfl.ch/trac/scala/

--j

On Thu, Feb 5, 2009 at 3:46 PM, Seth Tisue <seth@tisue.net> wrote:
>>>>> "Jon" == Jon Pretty <jon.pretty@sygneca.com> writes:

 Jon> Doing a quick grep of the Scala source code, strictfp isn't used
 Jon> (but the compiler is vaguely aware of it, for completeness,
 Jon> presumably).  I suspect the reason it's not supported is lack of
 Jon> demand.  Java got away without it until version 5, didn't it?

strictfp has been around for over 10 years -- since Java 1.2.
It's important to some scientific users.

Most users justifiably don't care, but if you're doing some kinds of
scientific computing, then exact reproducibility of floating point
results cross-platform is important.  For example, in our simulation
tool NetLogo, we promise users that if they run their simulation with
the same random seed, they'll get the same results every time, no matter
what computer they're on.  This ensures that published simulation
results can be reproduced.  And that promise rests on Java's strictfp
promise.

It's also convenient for testing purposes (in any application domain)
not to have to worry about whether results can vary slightly from
machine to machine.

It would certainly be nice if Scala supported strictfp declarations (an
annotation instead of a keyword would be fine).  I don't have any actual
simulation engine code in Scala right now, but when I do, I guess I'll
have to find a way to post-process the class files generated by scalac
in order to set the strictfp flag.

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland