128-bit IEEE DFP

# Andrew Paprocki (14 years ago)

I see there was a bunch of work done to possibly introduce 128-bit IEEE754r DFP back in the ES4 days:

doku.php?id=proposals:decimal&s=decimal

Has any work been done since ES4 to introduce a DFP type?

# Erik Corry (14 years ago)

2012/3/17 Andrew Paprocki <andrew at ishiboo.com>:

I see there was a bunch of work done to possibly introduce 128-bit IEEE754r DFP back in the ES4 days:

doku.php?id=proposals:decimal&s=decimal

Has any work been done since ES4 to introduce a DFP type?

Hopefully, no, but in the mean time, Dart has introduced arbitrary precision integers.

# Brendan Eich (14 years ago)

Yes, Sam Ruby prototyped a new Decimal built-in for SpiderMonkey, with operators. This was in mid-2008 when ES4 was going down. See

bugzilla.mozilla.org/show_bug.cgi?id=445178

TC39 rejected hardcoding IEEE DFP into JS at the 2008 fall "Kona" meeting:

esdiscuss/2008-November/008179

Waldemar: "Decimal is out because the spec isn't ready and there are some problems that are not small spec errors -- generic behavior of functions, etc."

Some discussion lingered on:

esdiscuss/2009-January/008630

The plan since then is to add value types or proxies to the language, so that Decimal, Complex, etc. with operators and literals for good usability may be added by library authors. See

strawman:value_proxies

and

users.soe.ucsc.edu/~cormac/papers/oopsla11.pdf

See also (from 2010) a hardcoded bignums strawman:

strawman:bignums

# Brendan Eich (14 years ago)

Supported yet by the Dart-to-JS compiler? How is the performance?

strawman:bignums

could help -- of course we did not hear about Dart's requirements in time for ES6.

Arguably Dart doesn't matter. Lots of languages with bignums compile to JS. We could add bignums to the Harmony agenda to support all such languages, and hardcode them instead of developing Flanagan et al.'s virtual values work. My reading of TC39 is that no one wants to hardcode. But I'll throw this out for discussion.