Re:Binary in JavaScript
by thomasfoster96 on Wednesday July 29, 2015 @04:21AM
(#9967050)
This whole problem will probably be solved with Typed Objects, which looks as though they'll be standardised with ES7 next year. Plus, there's already a decent typed objects polyfill available, so don't go littering your code with bitwise operations.
[ Parent
| on HN ]
That's good to hear, I wasn't aware of Typed Objects. I guess the library linked at the end of the post is basically a very non-specific polyfill already? Well, using it like that is one way to get around bitwise littering.
Re:Binary in JavaScript
by thomasfoster96 on Wednesday July 29, 2015 @10:18AM
(#9968754)
The library at the bottom isn't anywhere near a typed objects polyfill - it just packs data into small spaces. Typed Objevts would let you have objects where properties are of a static type (int8, Boolean, string) and they are stored using Array Buffers.