Some Typed Objects Confusion
On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
In this page, and in the latest meeting note too, I can read both uint8 and Uint8, as example.
Bug. Fixed, thanks.
The Question How is
new StructType({x:Uint32, y:Uint32})
supposes to understand the type?instanceof Uint32
ortypeof v === "uint32"
or ... both in case ofboolean
andstring
?
Neither. It tells you that the x and y fields have typeof 'number' and that their values are constrained to be integers in the range [0, 2^32).
A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far.
Nikhil Marathe and Niko Matsakis are actively working on the implementation for SpiderMonkey: bugzilla.mozilla.org/show_bug.cgi?id=578700
Dmitriy Lomov is actively working on updating the prollyfill to match the current API: dherman/structs.js, dherman/structs.js#12
Not sure if anyone on the V8 team (which includes Dmitriy) has started implementation but I believe they're interested. Right now Dmitriy is focused on the prollyfill and spec.
On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > [In this page](http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the latest meeting note too, I can read both uint8 and Uint8, as example. Bug. Fixed, thanks. > **The Question** > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in case of `boolean` and `string` ? Neither. It tells you that the x and y fields have typeof 'number' and that their values are constrained to be integers in the range [0, 2^32). > A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far. Nikhil Marathe and Niko Matsakis are actively working on the implementation for SpiderMonkey: https://bugzilla.mozilla.org/show_bug.cgi?id=578700 Dmitriy Lomov is actively working on updating the prollyfill to match the current API: https://github.com/dherman/structs.js https://github.com/dherman/structs.js/pull/12 Not sure if anyone on the V8 team (which includes Dmitriy) has started implementation but I believe they're interested. Right now Dmitriy is focused on the prollyfill and spec. Dave
Awesome,
Awesome, thanks! On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> wrote: > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > [In this page]( > http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the > latest meeting note too, I can read both uint8 and Uint8, as example. > > Bug. Fixed, thanks. > > > **The Question** > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand the > type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in case of > `boolean` and `string` ? > > Neither. It tells you that the x and y fields have typeof 'number' and > that their values are constrained to be integers in the range [0, 2^32). > > > A bonus question would be: does anybody know when this stuff is planned > to go out? Not a single beta/alpha channel is exposing anything at all so > far. > > Nikhil Marathe and Niko Matsakis are actively working on the > implementation for SpiderMonkey: > > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 > > Dmitriy Lomov is actively working on updating the prollyfill to match the > current API: > > https://github.com/dherman/structs.js > https://github.com/dherman/structs.js/pull/12 > > Not sure if anyone on the V8 team (which includes Dmitriy) has started > implementation but I believe they're interested. Right now Dmitriy is > focused on the prollyfill and spec. > > Dave > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130820/70cfadca/attachment.html>
Uhm, just a couple of extra question about that page if/when you have time:
- string and boolean are mentioned, but nowhere in your
struct.js
prolyfill code. Will string and boolean be accepted? Object
andAny
are mentioned, but exported as object and any in yourstruct.js
prolyfill example. W- Which is the right way?
The reason I am asking is to be able to create code that does absolutely nothing (for performance reason) but will look like the real thing so I can start experimenting with static structures and possibly a develop VS production version of an ES3 to ES5 compatible polyfill since I believe your code won't run anywhere except in SpiderMonkey (which is OK but it's not suitable for a lightweight migration to "structure like" logic)
Thanks.
Uhm, just a couple of extra question about that page if/when you have time: 1. string and boolean are mentioned, but nowhere in your `struct.js` prolyfill code. Will string and boolean be accepted? 2. `Object` and `Any` are mentioned, but exported as object and any in your `struct.js` prolyfill example. W 3. Which is the right way? The reason I am asking is to be able to create code that does absolutely nothing (for performance reason) but will look like the real thing so I can start experimenting with static structures and possibly a develop VS production version of an ES3 to ES5 compatible polyfill since I believe your code won't run anywhere except in SpiderMonkey (which is OK but it's not suitable for a lightweight migration to "structure like" logic) Thanks. On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < andrea.giammarchi at gmail.com> wrote: > Awesome, thanks! > > > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> wrote: > >> On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> >> > [In this page]( >> http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in >> the latest meeting note too, I can read both uint8 and Uint8, as example. >> >> Bug. Fixed, thanks. >> >> > **The Question** >> > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand >> the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in >> case of `boolean` and `string` ? >> >> Neither. It tells you that the x and y fields have typeof 'number' and >> that their values are constrained to be integers in the range [0, 2^32). >> >> > A bonus question would be: does anybody know when this stuff is planned >> to go out? Not a single beta/alpha channel is exposing anything at all so >> far. >> >> Nikhil Marathe and Niko Matsakis are actively working on the >> implementation for SpiderMonkey: >> >> https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >> >> Dmitriy Lomov is actively working on updating the prollyfill to match the >> current API: >> >> https://github.com/dherman/structs.js >> https://github.com/dherman/structs.js/pull/12 >> >> Not sure if anyone on the V8 team (which includes Dmitriy) has started >> implementation but I believe they're interested. Right now Dmitriy is >> focused on the prollyfill and spec. >> >> Dave >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130820/957c11ab/attachment-0001.html>
sorry, point 3 was actually the question about point 2
sorry, point 3 was actually the question about point 2 On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < andrea.giammarchi at gmail.com> wrote: > Uhm, just a couple of extra question about that page if/when you have time: > > 1. string and boolean are mentioned, but nowhere in your `struct.js` > prolyfill code. Will string and boolean be accepted? > 2. `Object` and `Any` are mentioned, but exported as object and any in > your `struct.js` prolyfill example. W > 3. Which is the right way? > > The reason I am asking is to be able to create code that does absolutely > nothing (for performance reason) but will look like the real thing so I can > start experimenting with static structures and possibly a develop VS > production version of an ES3 to ES5 compatible polyfill since I believe > your code won't run anywhere except in SpiderMonkey (which is OK but it's > not suitable for a lightweight migration to "structure like" logic) > > Thanks. > > > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > >> Awesome, thanks! >> >> >> On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com>wrote: >> >>> On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < >>> andrea.giammarchi at gmail.com> wrote: >>> >>> > [In this page]( >>> http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in >>> the latest meeting note too, I can read both uint8 and Uint8, as example. >>> >>> Bug. Fixed, thanks. >>> >>> > **The Question** >>> > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand >>> the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in >>> case of `boolean` and `string` ? >>> >>> Neither. It tells you that the x and y fields have typeof 'number' and >>> that their values are constrained to be integers in the range [0, 2^32). >>> >>> > A bonus question would be: does anybody know when this stuff is >>> planned to go out? Not a single beta/alpha channel is exposing anything at >>> all so far. >>> >>> Nikhil Marathe and Niko Matsakis are actively working on the >>> implementation for SpiderMonkey: >>> >>> https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >>> >>> Dmitriy Lomov is actively working on updating the prollyfill to match >>> the current API: >>> >>> https://github.com/dherman/structs.js >>> https://github.com/dherman/structs.js/pull/12 >>> >>> Not sure if anyone on the V8 team (which includes Dmitriy) has started >>> implementation but I believe they're interested. Right now Dmitriy is >>> focused on the prollyfill and spec. >>> >>> Dave >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130820/24837477/attachment.html>
string, boolean, object and any are all lowercase (we should fix the wiki)
FWIW, I am already working on a new version of polyfill. It is fully ES5. Here is a pull request: dherman/structs.js#12 - I'll merge it soon, and work more to cover everything in the proposal.
string, boolean, object and any are all lowercase (we should fix the wiki) FWIW, I am already working on a new version of polyfill. It is fully ES5. Here is a pull request: https://github.com/dherman/structs.js/pull/12 - I'll merge it soon, and work more to cover everything in the proposal. Thanks, Dmitry On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi < andrea.giammarchi at gmail.com> wrote: > sorry, point 3 was actually the question about point 2 > > > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > >> Uhm, just a couple of extra question about that page if/when you have >> time: >> >> 1. string and boolean are mentioned, but nowhere in your `struct.js` >> prolyfill code. Will string and boolean be accepted? >> 2. `Object` and `Any` are mentioned, but exported as object and any >> in your `struct.js` prolyfill example. W >> 3. Which is the right way? >> >> The reason I am asking is to be able to create code that does absolutely >> nothing (for performance reason) but will look like the real thing so I can >> start experimenting with static structures and possibly a develop VS >> production version of an ES3 to ES5 compatible polyfill since I believe >> your code won't run anywhere except in SpiderMonkey (which is OK but it's >> not suitable for a lightweight migration to "structure like" logic) >> >> Thanks. >> >> >> On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> >>> Awesome, thanks! >>> >>> >>> On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com>wrote: >>> >>>> On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < >>>> andrea.giammarchi at gmail.com> wrote: >>>> >>>> > [In this page]( >>>> http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in >>>> the latest meeting note too, I can read both uint8 and Uint8, as example. >>>> >>>> Bug. Fixed, thanks. >>>> >>>> > **The Question** >>>> > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand >>>> the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in >>>> case of `boolean` and `string` ? >>>> >>>> Neither. It tells you that the x and y fields have typeof 'number' and >>>> that their values are constrained to be integers in the range [0, 2^32). >>>> >>>> > A bonus question would be: does anybody know when this stuff is >>>> planned to go out? Not a single beta/alpha channel is exposing anything at >>>> all so far. >>>> >>>> Nikhil Marathe and Niko Matsakis are actively working on the >>>> implementation for SpiderMonkey: >>>> >>>> https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >>>> >>>> Dmitriy Lomov is actively working on updating the prollyfill to match >>>> the current API: >>>> >>>> https://github.com/dherman/structs.js >>>> https://github.com/dherman/structs.js/pull/12 >>>> >>>> Not sure if anyone on the V8 team (which includes Dmitriy) has started >>>> implementation but I believe they're interested. Right now Dmitriy is >>>> focused on the prollyfill and spec. >>>> >>>> Dave >>>> >>>> >>> >> > > _______________________________________________ > 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/20130821/08149845/attachment.html>
excellent, I'll keep an eye on that, which is perfect when debug and more checks are needed.
What I meant with previous email is basically summarized in this gist
The fakelyfill ^_^ code is there to offer similar behavior without compromising too much performance.
What I find extremely useful about Typed Objects is not just some WebGL exchange, rather the possibility to finally have proper fixed and fast objects for libraries, database or NoSQL results, and JSON de-serialization.
I really cannot wait to see this happening, places where applications could benefit from Typed Objects, if these will be closely fast as asm.js could be with native, are more than we could think about right now with such JS history/background.
Thanks for working on this and have a nice day.
excellent, I'll keep an eye on that, which is perfect when debug and more checks are needed. What I meant with previous email is basically [summarized in this gist]( https://gist.github.com/WebReflection/6296790) The _fakelyfill_ ^_^ code is there to offer similar behavior without compromising too much performance. What I find extremely useful about Typed Objects is not just some WebGL exchange, rather the possibility to finally have proper fixed and fast objects for libraries, database or NoSQL results, and JSON de-serialization. I really cannot wait to see this happening, places where applications could benefit from Typed Objects, if these will be closely fast as asm.js could be with native, are more than we could think about right now with such JS history/background. Thanks for working on this and have a nice day. On Wed, Aug 21, 2013 at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: > string, boolean, object and any are all lowercase (we should fix the wiki) > > FWIW, I am already working on a new version of polyfill. It is fully ES5. > Here is a pull request: https://github.com/dherman/structs.js/pull/12 - > I'll merge it soon, and work more to cover everything in the proposal. > > Thanks, > Dmitry > > > > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > >> sorry, point 3 was actually the question about point 2 >> >> >> On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> >>> Uhm, just a couple of extra question about that page if/when you have >>> time: >>> >>> 1. string and boolean are mentioned, but nowhere in your `struct.js` >>> prolyfill code. Will string and boolean be accepted? >>> 2. `Object` and `Any` are mentioned, but exported as object and any >>> in your `struct.js` prolyfill example. W >>> 3. Which is the right way? >>> >>> The reason I am asking is to be able to create code that does absolutely >>> nothing (for performance reason) but will look like the real thing so I can >>> start experimenting with static structures and possibly a develop VS >>> production version of an ES3 to ES5 compatible polyfill since I believe >>> your code won't run anywhere except in SpiderMonkey (which is OK but it's >>> not suitable for a lightweight migration to "structure like" logic) >>> >>> Thanks. >>> >>> >>> On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < >>> andrea.giammarchi at gmail.com> wrote: >>> >>>> Awesome, thanks! >>>> >>>> >>>> On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com>wrote: >>>> >>>>> On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < >>>>> andrea.giammarchi at gmail.com> wrote: >>>>> >>>>> > [In this page]( >>>>> http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in >>>>> the latest meeting note too, I can read both uint8 and Uint8, as example. >>>>> >>>>> Bug. Fixed, thanks. >>>>> >>>>> > **The Question** >>>>> > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand >>>>> the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in >>>>> case of `boolean` and `string` ? >>>>> >>>>> Neither. It tells you that the x and y fields have typeof 'number' and >>>>> that their values are constrained to be integers in the range [0, 2^32). >>>>> >>>>> > A bonus question would be: does anybody know when this stuff is >>>>> planned to go out? Not a single beta/alpha channel is exposing anything at >>>>> all so far. >>>>> >>>>> Nikhil Marathe and Niko Matsakis are actively working on the >>>>> implementation for SpiderMonkey: >>>>> >>>>> https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >>>>> >>>>> Dmitriy Lomov is actively working on updating the prollyfill to match >>>>> the current API: >>>>> >>>>> https://github.com/dherman/structs.js >>>>> https://github.com/dherman/structs.js/pull/12 >>>>> >>>>> Not sure if anyone on the V8 team (which includes Dmitriy) has started >>>>> implementation but I believe they're interested. Right now Dmitriy is >>>>> focused on the prollyfill and spec. >>>>> >>>>> Dave >>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> 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/20130821/92a87b7d/attachment.html>
Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase.
Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase. Dave On Aug 21, 2013, at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: > string, boolean, object and any are all lowercase (we should fix the wiki) > > FWIW, I am already working on a new version of polyfill. It is fully ES5. > Here is a pull request: https://github.com/dherman/structs.js/pull/12 - I'll merge it soon, and work more to cover everything in the proposal. > > Thanks, > Dmitry > > > > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > sorry, point 3 was actually the question about point 2 > > > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > Uhm, just a couple of extra question about that page if/when you have time: > • string and boolean are mentioned, but nowhere in your `struct.js` prolyfill code. Will string and boolean be accepted? > • `Object` and `Any` are mentioned, but exported as object and any in your `struct.js` prolyfill example. W > • Which is the right way? > The reason I am asking is to be able to create code that does absolutely nothing (for performance reason) but will look like the real thing so I can start experimenting with static structures and possibly a develop VS production version of an ES3 to ES5 compatible polyfill since I believe your code won't run anywhere except in SpiderMonkey (which is OK but it's not suitable for a lightweight migration to "structure like" logic) > > Thanks. > > > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > Awesome, thanks! > > > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> wrote: > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > > > [In this page](http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the latest meeting note too, I can read both uint8 and Uint8, as example. > > Bug. Fixed, thanks. > > > **The Question** > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in case of `boolean` and `string` ? > > Neither. It tells you that the x and y fields have typeof 'number' and that their values are constrained to be integers in the range [0, 2^32). > > > A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far. > > Nikhil Marathe and Niko Matsakis are actively working on the implementation for SpiderMonkey: > > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 > > Dmitriy Lomov is actively working on updating the prollyfill to match the current API: > > https://github.com/dherman/structs.js > https://github.com/dherman/structs.js/pull/12 > > Not sure if anyone on the V8 team (which includes Dmitriy) has started implementation but I believe they're interested. Right now Dmitriy is focused on the prollyfill and spec. > > Dave > > > > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
Hmm really? I am not sure - how this reconciles with existing Object and String? Even if this is imported from a module, the clashing will be unfortunate.
Hmm really? I am not sure - how this reconciles with existing Object and String? Even if this is imported from a module, the clashing will be unfortunate. Dmitry On Wed, Aug 21, 2013 at 9:02 PM, David Herman <dherman at mozilla.com> wrote: > Any, String and Object should still be uppercase. The naming convention > is: value types lowercase, reference types uppercase. > > Dave > > On Aug 21, 2013, at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: > > > string, boolean, object and any are all lowercase (we should fix the > wiki) > > > > FWIW, I am already working on a new version of polyfill. It is fully ES5. > > Here is a pull request: https://github.com/dherman/structs.js/pull/12 - > I'll merge it soon, and work more to cover everything in the proposal. > > > > Thanks, > > Dmitry > > > > > > > > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > sorry, point 3 was actually the question about point 2 > > > > > > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > Uhm, just a couple of extra question about that page if/when you have > time: > > • string and boolean are mentioned, but nowhere in your > `struct.js` prolyfill code. Will string and boolean be accepted? > > • `Object` and `Any` are mentioned, but exported as object and any > in your `struct.js` prolyfill example. W > > • Which is the right way? > > The reason I am asking is to be able to create code that does absolutely > nothing (for performance reason) but will look like the real thing so I can > start experimenting with static structures and possibly a develop VS > production version of an ES3 to ES5 compatible polyfill since I believe > your code won't run anywhere except in SpiderMonkey (which is OK but it's > not suitable for a lightweight migration to "structure like" logic) > > > > Thanks. > > > > > > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > Awesome, thanks! > > > > > > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> > wrote: > > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > > > [In this page]( > http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the > latest meeting note too, I can read both uint8 and Uint8, as example. > > > > Bug. Fixed, thanks. > > > > > **The Question** > > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand > the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in > case of `boolean` and `string` ? > > > > Neither. It tells you that the x and y fields have typeof 'number' and > that their values are constrained to be integers in the range [0, 2^32). > > > > > A bonus question would be: does anybody know when this stuff is > planned to go out? Not a single beta/alpha channel is exposing anything at > all so far. > > > > Nikhil Marathe and Niko Matsakis are actively working on the > implementation for SpiderMonkey: > > > > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 > > > > Dmitriy Lomov is actively working on updating the prollyfill to match > the current API: > > > > https://github.com/dherman/structs.js > > https://github.com/dherman/structs.js/pull/12 > > > > Not sure if anyone on the V8 team (which includes Dmitriy) has started > implementation but I believe they're interested. Right now Dmitriy is > focused on the prollyfill and spec. > > > > Dave > > > > > > > > > > > > _______________________________________________ > > 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/20130821/083fbb55/attachment.html>
I guess you would not import/export Object, Boolean and String from a
module (while Any will be exported .. uhm, feels weird) ... but for
instanceof
consistency sake I agree either constructors or lowered_cases
pseudo "types"
I guess you would not import/export Object, Boolean and String from a module (while Any will be exported .. uhm, feels weird) ... but for `instanceof` consistency sake I agree either constructors or lowered_cases pseudo "types" On Wed, Aug 21, 2013 at 12:26 PM, Dmitry Lomov <dslomov at chromium.org> wrote: > Hmm really? I am not sure - how this reconciles with existing Object and > String? > Even if this is imported from a module, the clashing will be unfortunate. > > Dmitry > > > On Wed, Aug 21, 2013 at 9:02 PM, David Herman <dherman at mozilla.com> wrote: > >> Any, String and Object should still be uppercase. The naming convention >> is: value types lowercase, reference types uppercase. >> >> Dave >> >> On Aug 21, 2013, at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: >> >> > string, boolean, object and any are all lowercase (we should fix the >> wiki) >> > >> > FWIW, I am already working on a new version of polyfill. It is fully >> ES5. >> > Here is a pull request: https://github.com/dherman/structs.js/pull/12- I'll merge it soon, and work more to cover everything in the proposal. >> > >> > Thanks, >> > Dmitry >> > >> > >> > >> > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> > sorry, point 3 was actually the question about point 2 >> > >> > >> > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> > Uhm, just a couple of extra question about that page if/when you have >> time: >> > • string and boolean are mentioned, but nowhere in your >> `struct.js` prolyfill code. Will string and boolean be accepted? >> > • `Object` and `Any` are mentioned, but exported as object and >> any in your `struct.js` prolyfill example. W >> > • Which is the right way? >> > The reason I am asking is to be able to create code that does >> absolutely nothing (for performance reason) but will look like the real >> thing so I can start experimenting with static structures and possibly a >> develop VS production version of an ES3 to ES5 compatible polyfill since I >> believe your code won't run anywhere except in SpiderMonkey (which is OK >> but it's not suitable for a lightweight migration to "structure like" logic) >> > >> > Thanks. >> > >> > >> > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> > Awesome, thanks! >> > >> > >> > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> >> wrote: >> > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < >> andrea.giammarchi at gmail.com> wrote: >> > >> > > [In this page]( >> http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in >> the latest meeting note too, I can read both uint8 and Uint8, as example. >> > >> > Bug. Fixed, thanks. >> > >> > > **The Question** >> > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand >> the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in >> case of `boolean` and `string` ? >> > >> > Neither. It tells you that the x and y fields have typeof 'number' and >> that their values are constrained to be integers in the range [0, 2^32). >> > >> > > A bonus question would be: does anybody know when this stuff is >> planned to go out? Not a single beta/alpha channel is exposing anything at >> all so far. >> > >> > Nikhil Marathe and Niko Matsakis are actively working on the >> implementation for SpiderMonkey: >> > >> > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >> > >> > Dmitriy Lomov is actively working on updating the prollyfill to match >> the current API: >> > >> > https://github.com/dherman/structs.js >> > https://github.com/dherman/structs.js/pull/12 >> > >> > Not sure if anyone on the V8 team (which includes Dmitriy) has started >> implementation but I believe they're interested. Right now Dmitriy is >> focused on the prollyfill and spec. >> > >> > Dave >> > >> > >> > >> > >> > >> > _______________________________________________ >> > 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/20130821/acfb3f57/attachment.html>
Let's take this off-list. Bikeshed territory.
Let's take this off-list. Bikeshed territory. Dave On Aug 21, 2013, at 12:26 PM, Dmitry Lomov <dslomov at chromium.org> wrote: > Hmm really? I am not sure - how this reconciles with existing Object and String? > Even if this is imported from a module, the clashing will be unfortunate. > > Dmitry > > > On Wed, Aug 21, 2013 at 9:02 PM, David Herman <dherman at mozilla.com> wrote: > Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase. > > Dave > > On Aug 21, 2013, at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: > > > string, boolean, object and any are all lowercase (we should fix the wiki) > > > > FWIW, I am already working on a new version of polyfill. It is fully ES5. > > Here is a pull request: https://github.com/dherman/structs.js/pull/12 - I'll merge it soon, and work more to cover everything in the proposal. > > > > Thanks, > > Dmitry > > > > > > > > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > > sorry, point 3 was actually the question about point 2 > > > > > > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > > Uhm, just a couple of extra question about that page if/when you have time: > > • string and boolean are mentioned, but nowhere in your `struct.js` prolyfill code. Will string and boolean be accepted? > > • `Object` and `Any` are mentioned, but exported as object and any in your `struct.js` prolyfill example. W > > • Which is the right way? > > The reason I am asking is to be able to create code that does absolutely nothing (for performance reason) but will look like the real thing so I can start experimenting with static structures and possibly a develop VS production version of an ES3 to ES5 compatible polyfill since I believe your code won't run anywhere except in SpiderMonkey (which is OK but it's not suitable for a lightweight migration to "structure like" logic) > > > > Thanks. > > > > > > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > > Awesome, thanks! > > > > > > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> wrote: > > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote: > > > > > [In this page](http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the latest meeting note too, I can read both uint8 and Uint8, as example. > > > > Bug. Fixed, thanks. > > > > > **The Question** > > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in case of `boolean` and `string` ? > > > > Neither. It tells you that the x and y fields have typeof 'number' and that their values are constrained to be integers in the range [0, 2^32). > > > > > A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far. > > > > Nikhil Marathe and Niko Matsakis are actively working on the implementation for SpiderMonkey: > > > > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 > > > > Dmitriy Lomov is actively working on updating the prollyfill to match the current API: > > > > https://github.com/dherman/structs.js > > https://github.com/dherman/structs.js/pull/12 > > > > Not sure if anyone on the V8 team (which includes Dmitriy) has started implementation but I believe they're interested. Right now Dmitriy is focused on the prollyfill and spec. > > > > Dave > > > > > > > > > > > > _______________________________________________ > > es-discuss mailing list > > es-discuss at mozilla.org > > https://mail.mozilla.org/listinfo/es-discuss > > > > > >
can you guys please come back with an answer or finalize the decision in the wiki once discussed?
can you guys please come back with an answer or finalize the decision in the wiki once discussed? Thanks On Wed, Aug 21, 2013 at 1:23 PM, David Herman <dherman at mozilla.com> wrote: > Let's take this off-list. Bikeshed territory. > > Dave > > On Aug 21, 2013, at 12:26 PM, Dmitry Lomov <dslomov at chromium.org> wrote: > > > Hmm really? I am not sure - how this reconciles with existing Object and > String? > > Even if this is imported from a module, the clashing will be unfortunate. > > > > Dmitry > > > > > > On Wed, Aug 21, 2013 at 9:02 PM, David Herman <dherman at mozilla.com> > wrote: > > Any, String and Object should still be uppercase. The naming convention > is: value types lowercase, reference types uppercase. > > > > Dave > > > > On Aug 21, 2013, at 4:21 AM, Dmitry Lomov <dslomov at chromium.org> wrote: > > > > > string, boolean, object and any are all lowercase (we should fix the > wiki) > > > > > > FWIW, I am already working on a new version of polyfill. It is fully > ES5. > > > Here is a pull request: https://github.com/dherman/structs.js/pull/12- I'll merge it soon, and work more to cover everything in the proposal. > > > > > > Thanks, > > > Dmitry > > > > > > > > > > > > On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > sorry, point 3 was actually the question about point 2 > > > > > > > > > On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > Uhm, just a couple of extra question about that page if/when you have > time: > > > • string and boolean are mentioned, but nowhere in your > `struct.js` prolyfill code. Will string and boolean be accepted? > > > • `Object` and `Any` are mentioned, but exported as object and > any in your `struct.js` prolyfill example. W > > > • Which is the right way? > > > The reason I am asking is to be able to create code that does > absolutely nothing (for performance reason) but will look like the real > thing so I can start experimenting with static structures and possibly a > develop VS production version of an ES3 to ES5 compatible polyfill since I > believe your code won't run anywhere except in SpiderMonkey (which is OK > but it's not suitable for a lightweight migration to "structure like" logic) > > > > > > Thanks. > > > > > > > > > On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > Awesome, thanks! > > > > > > > > > On Tue, Aug 20, 2013 at 4:12 PM, David Herman <dherman at mozilla.com> > wrote: > > > On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi < > andrea.giammarchi at gmail.com> wrote: > > > > > > > [In this page]( > http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the > latest meeting note too, I can read both uint8 and Uint8, as example. > > > > > > Bug. Fixed, thanks. > > > > > > > **The Question** > > > > How is `new StructType({x:Uint32, y:Uint32})` supposes to understand > the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in > case of `boolean` and `string` ? > > > > > > Neither. It tells you that the x and y fields have typeof 'number' and > that their values are constrained to be integers in the range [0, 2^32). > > > > > > > A bonus question would be: does anybody know when this stuff is > planned to go out? Not a single beta/alpha channel is exposing anything at > all so far. > > > > > > Nikhil Marathe and Niko Matsakis are actively working on the > implementation for SpiderMonkey: > > > > > > https://bugzilla.mozilla.org/show_bug.cgi?id=578700 > > > > > > Dmitriy Lomov is actively working on updating the prollyfill to match > the current API: > > > > > > https://github.com/dherman/structs.js > > > https://github.com/dherman/structs.js/pull/12 > > > > > > Not sure if anyone on the V8 team (which includes Dmitriy) has started > implementation but I believe they're interested. Right now Dmitriy is > focused on the prollyfill and spec. > > > > > > Dave > > > > > > > > > > > > > > > > > > _______________________________________________ > > > 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/20130821/134c5cba/attachment.html>
David Herman wrote:
Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase.
Is String really a reference type? Currently you can't tell, and JS docs and books don't (AFAIK) say "reference type" apart from object (not null; including function). String also happens to spell the constructor/converter function, which sadly both returns a primitive and creates a String object depending on how it is called.
Implementations can support strings using copy and reference types under the hood (short strings get copied). No mutation and no extensibility of the string primitive value type mean no way to tell it's a reference. For these reasons and to avoid the String constructor connotation, I find 'string' winning in this typed objects setting.
David Herman wrote: > Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase. Is String really a reference type? Currently you can't tell, and JS docs and books don't (AFAIK) say "reference type" apart from object (not null; including function). String also happens to spell the constructor/converter function, which sadly both returns a primitive and creates a String object depending on how it is called. Implementations can support strings using copy and reference types under the hood (short strings get copied). No mutation and no extensibility of the string primitive value type mean no way to tell it's a reference. For these reasons and to avoid the String constructor connotation, I find 'string' winning in this typed objects setting. /be > > Dave > > On Aug 21, 2013, at 4:21 AM, Dmitry Lomov<dslomov at chromium.org> wrote: > >> string, boolean, object and any are all lowercase (we should fix the wiki) >> >> FWIW, I am already working on a new version of polyfill. It is fully ES5. >> Here is a pull request: https://github.com/dherman/structs.js/pull/12 - I'll merge it soon, and work more to cover everything in the proposal. >> >> Thanks, >> Dmitry >> >> >> >> On Wed, Aug 21, 2013 at 3:21 AM, Andrea Giammarchi<andrea.giammarchi at gmail.com> wrote: >> sorry, point 3 was actually the question about point 2 >> >> >> On Tue, Aug 20, 2013 at 6:20 PM, Andrea Giammarchi<andrea.giammarchi at gmail.com> wrote: >> Uhm, just a couple of extra question about that page if/when you have time: >> • string and boolean are mentioned, but nowhere in your `struct.js` prolyfill code. Will string and boolean be accepted? >> • `Object` and `Any` are mentioned, but exported as object and any in your `struct.js` prolyfill example. W >> • Which is the right way? >> The reason I am asking is to be able to create code that does absolutely nothing (for performance reason) but will look like the real thing so I can start experimenting with static structures and possibly a develop VS production version of an ES3 to ES5 compatible polyfill since I believe your code won't run anywhere except in SpiderMonkey (which is OK but it's not suitable for a lightweight migration to "structure like" logic) >> >> Thanks. >> >> >> On Tue, Aug 20, 2013 at 4:55 PM, Andrea Giammarchi<andrea.giammarchi at gmail.com> wrote: >> Awesome, thanks! >> >> >> On Tue, Aug 20, 2013 at 4:12 PM, David Herman<dherman at mozilla.com> wrote: >> On Aug 20, 2013, at 1:31 PM, Andrea Giammarchi<andrea.giammarchi at gmail.com> wrote: >> >>> [In this page](http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects), and in the latest meeting note too, I can read both uint8 and Uint8, as example. >> Bug. Fixed, thanks. >> >>> **The Question** >>> How is `new StructType({x:Uint32, y:Uint32})` supposes to understand the type? `instanceof Uint32` or `typeof v === "uint32"` or ... both in case of `boolean` and `string` ? >> Neither. It tells you that the x and y fields have typeof 'number' and that their values are constrained to be integers in the range [0, 2^32). >> >>> A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far. >> Nikhil Marathe and Niko Matsakis are actively working on the implementation for SpiderMonkey: >> >> https://bugzilla.mozilla.org/show_bug.cgi?id=578700 >> >> Dmitriy Lomov is actively working on updating the prollyfill to match the current API: >> >> https://github.com/dherman/structs.js >> https://github.com/dherman/structs.js/pull/12 >> >> Not sure if anyone on the V8 team (which includes Dmitriy) has started implementation but I believe they're interested. Right now Dmitriy is focused on the prollyfill and spec. >> >> Dave >> >> >> >> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss >
On Aug 21, 2013, at 2:36 PM, Brendan Eich <brendan at mozilla.com> wrote:
David Herman wrote:
Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase.
Is String really a reference type? Currently you can't tell, and JS docs and books don't (AFAIK) say "reference type" apart from object (not null; including function). String also happens to spell the constructor/converter function, which sadly both returns a primitive and creates a String object depending on how it is called.
You can tell, in that a type that includes String must be opaque. The might-be-a-pointer property of a type is observable in the typed objects API in that it cannot expose its backing storage as an ArrayBuffer. Strings necessarily might-be-a-pointer.
I take your point that it's confusing on the primitive/object axis, though.
So... all right, let's break out those paintbrushes. Let's say we use the lowercase naming convention for purely immutable types, independent of whether they might-be-a-pointer. This still leaves Dmitry's question about the unfortunate name collision -- even though modules make this "okay," it's still a PITA in practice not to be able to import Object without shadowing the built-in Object.
Personally I'd be fine with just lowercasing all the things. Brendan, you cared about using capitalization for object types, though. What color is your bikeshed?
On Aug 21, 2013, at 2:36 PM, Brendan Eich <brendan at mozilla.com> wrote: > David Herman wrote: >> Any, String and Object should still be uppercase. The naming convention is: value types lowercase, reference types uppercase. > > Is String really a reference type? Currently you can't tell, and JS docs and books don't (AFAIK) say "reference type" apart from object (not null; including function). String also happens to spell the constructor/converter function, which sadly both returns a primitive and creates a String object depending on how it is called. You can tell, in that a type that includes String must be opaque. The might-be-a-pointer property of a type is observable in the typed objects API in that it cannot expose its backing storage as an ArrayBuffer. Strings necessarily might-be-a-pointer. I take your point that it's confusing on the primitive/object axis, though. So... all right, let's break out those paintbrushes. Let's say we use the lowercase naming convention for purely immutable types, independent of whether they might-be-a-pointer. This still leaves Dmitry's question about the unfortunate name collision -- even though modules make this "okay," it's still a PITA in practice not to be able to import Object without shadowing the built-in Object. Personally I'd be fine with just lowercasing all the things. Brendan, you cared about using capitalization for object types, though. What color is your bikeshed? Dave
I agree lower ALL the cases is a win ... also because boolean
, string
,
and object
, aren't reserved words while function obviously is so with
current proposal where object
means function
too and any
includes
null there's nothing ambiguous and less to bother about references.
I agree lower ALL the cases is a win ... also because `boolean`, `string`, and `object`, aren't reserved words while function obviously is so with current proposal where `object` means `function` too and `any` includes null there's nothing ambiguous and less to bother about references. On Wed, Aug 21, 2013 at 5:02 PM, David Herman <dherman at mozilla.com> wrote: > On Aug 21, 2013, at 2:36 PM, Brendan Eich <brendan at mozilla.com> wrote: > > > David Herman wrote: > >> Any, String and Object should still be uppercase. The naming convention > is: value types lowercase, reference types uppercase. > > > > Is String really a reference type? Currently you can't tell, and JS docs > and books don't (AFAIK) say "reference type" apart from object (not null; > including function). String also happens to spell the constructor/converter > function, which sadly both returns a primitive and creates a String object > depending on how it is called. > > You can tell, in that a type that includes String must be opaque. The > might-be-a-pointer property of a type is observable in the typed objects > API in that it cannot expose its backing storage as an ArrayBuffer. Strings > necessarily might-be-a-pointer. > > I take your point that it's confusing on the primitive/object axis, though. > > So... all right, let's break out those paintbrushes. Let's say we use the > lowercase naming convention for purely immutable types, independent of > whether they might-be-a-pointer. This still leaves Dmitry's question about > the unfortunate name collision -- even though modules make this "okay," > it's still a PITA in practice not to be able to import Object without > shadowing the built-in Object. > > Personally I'd be fine with just lowercasing all the things. Brendan, you > cared about using capitalization for object types, though. What color is > your bikeshed? > > Dave > > _______________________________________________ > 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/20130821/ebc6f010/attachment.html>
In this page, and in the latest meeting note too, I can read both uint8 and Uint8, as example.
Same if for all other types included
boolean
, andstring
, where these are historicallytypeof variable
without meaning variable isinstanceof String
orBoolean
.The Question How is
new StructType({x:Uint32, y:Uint32})
supposes to understand the type?instanceof Uint32
ortypeof v === "uint32"
or ... both in case ofboolean
andstring
?A bonus question would be: does anybody know when this stuff is planned to go out? Not a single beta/alpha channel is exposing anything at all so far.