Are there any 64-bit number proposals under consideration?
On Fri, Nov 13, 2015 at 1:00 AM, John Lenz <concavelenz at gmail.com> wrote:
By this I mean, a usable type like by mere mortals, not generated C++ code.
Maybe something like:
var v64 = LongNumber.from('2e58'); v64 = LongNumber.add(v64, 2);
It doesn't have to be pretty just reasonably and perform closer to native speed.
Word of advice, whatever you do, do NOT mention IEEE 754. Trust me. :-)
- Sam Ruby
I should have been more precise, I meant 64-bit integers, not greater precision floating points (although, I'm sure that would be interesting too).
Thanks for the pointer, what is that status of that?
You can view the current proposals here: tc39/ecma262
There are none that mention 64-bit types. The closest might be the "Typed Objects" proposal.
I started a competing type proposal (still in the theory stages) here sirisian/ecmascript-types in an effort to define types into the core language. (Compared to adding ad-hoc objects for every proposed type). Something like that would take years progress through the proposal system though. (Been too busy to finalize it and present it for stage 0).
Right now the lack of 64-bit integer types is also holding back the TypedArray stuff from supporting them. There was also this post from 4 years ago: esdiscuss.org/topic/value-objects
Not much progress on any fronts though from what I've seen. From reading a lot of the mailing list casually there were quite a few users against adding more types or extending the language with types in the past. Not sure if they're still here though.
There have been proposals for 64-bit integers in TC39 for the last 15 years. All of them so far have gotten bogged down by one of:
- extending the scope of the proposal to include value types, general operator overloading, etc., after which someone eventually objects to something or it becomes deferred to the next version of the standard
- arguments over implicit/explicit coercions (if f is a regular ECMAScript Number and n an int64, what should be the result of n + f? Think carefully.)
This is somewhat unfortunate.
Waldemar
so what is needed is a "maximally minimal int64 proposal"?
By this I mean, a usable type like by mere mortals, not generated C++ code.
Maybe something like:
var v64 = LongNumber.from('2e58'); v64 = LongNumber.add(v64, 2);
It doesn't have to be pretty just reasonably and perform closer to native speed.