Numeric Types

In attendance: Joe Darcy, Lubo, Brian, Per, and Robert.

Joe's comments --

  • long to/from double is a major source of conversion headaches
  • float is too low of precision to be useful
  • single numeric type (double) is a nightmare: array indexed by 2.5; isPrime, etc
  • smaller numeric types (short, byte, etc) are not "true" JVM types -- and have little use in the space
  • the combination of double and int is a good choice in the space -- provides good interop with libraries and best performance
  • alternative is double and infinite precision integer
  • infinite precision integer could be achieved with an extra Object field and two xor tests for overflow

Group consensus --

  • double and int used now
  • decision on infinite precision integer can be deferred without architectural impact
  • idea that infinite precision integer could be optionally supported (for small devices) was rejected on WORA grounds

Back to OpenJFX Compiler


I'd note that if you're accessing an array by index in jfx you're probably avoiding more set-oriented, declarative equivalents to something. It seems to me that it should be substantially easier for a runtime to optimize set notation and functions, versus procedural code.

var numbers = [ 1,4,7,4,3,7,9];
var odds = select n from numbers where n % 2 == 1;

Rossjudson 21:37, 1 March 2008 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.