typed objects and value types

Mark S. Miller erights at google.com
Wed Apr 2 09:20:11 PDT 2014

On Wed, Apr 2, 2014 at 7:32 AM, Niko Matsakis <niko at alum.mit.edu> 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/

Just a quick local editorial comment for now:

points[0].x = 1;
But assigning to a field of a value object like temp has no effect, and
hence the assignment is lost.

Please assume (and state if you feel it is needed) that all example code is
strict code. Introducing abstractions, like value types, that cause
assignments such as this to fail would be insane if the clients of these
abstractions were sloppy. If the client code were sloppy, these failures
would be silent as you state, and the code would proceed on execution paths
that assume success. By assuming that client code is sloppy, you
unnecessarily burden, distract, and mislead the reader, as not one in a
thousand truly understands the semantics of sloppy mode.

Substantive comments later. Quick reaction: I like it!

> Niko
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140402/5b800b0b/attachment-0001.html>

More information about the es-discuss mailing list