typed objects and value types

Waldemar Horwat waldemar at google.com
Mon Apr 7 16:27:40 PDT 2014


On 04/02/2014 07:32 AM, Niko Matsakis wrote:
> I just wanted to let people on es-discuss know about two of my recent
> blog posts concerning typed objects. The first is a kind of status
> report:
>
> http://smallcultfollowing.com/babysteps/blog/2014/04/01/typed-objects-status-report/
>
> and the second details some (preliminary) thoughts on how one could
> build on typed objects to support user-defined value types:
>
> http://smallcultfollowing.com/babysteps/blog/2014/04/01/value-types-in-javascript/

We've been tossing things like this around for a while.  I'd personally love to have some notion of value types along with int64 and friends (after having the proposals out for 15 years).  Note that these generally got bogged down on one of four issues:

- Handling of NaN's and ±0
- Direction of binary operator coercion (if x is an int64, is x+1 an int64 or a regular double Number?  What about x+0.5?)
- Built-in int64 vs. providing a library that allows folks to implement int64 (whichever one was proposed, folks wanted the other one)
- Cross-realm behavior

     Waldemar



More information about the es-discuss mailing list