structs.js

I’ve written a first draft prototype of structs.js, the binary data library we’re working on for the ECMAScript standard. It’s implemented using typed arrays, but it’s my hope that it can eventually subsume the important use cases of typed arrays. (Typed arrays let you do questionable things like cast data in platform-specific ways.)

For now the implementation only works in Firefox 4, because it’s using proxies. I have ideas about how to make it work in Safari and Chrome by backing off from proxies if they’re not available, and maybe even IE by shimming typed arrays using ordinary arrays.

Try it out! Feel free to send me feedback directly, or to es-discuss.

One Response to structs.js

  1. Pingback: Tweets that mention Hey, I made something: -- Topsy.com