Abstract

JavaScript's typed arrays have proven to be a crucial API for many JS applications, particularly those working with large amounts of data or emulating other languages. Unfortunately, the current typed array API offers no means of abstraction. Programmers are supplied with a simple byte buffer that can be viewed as an array of integers or floats, but nothing more. This paper presents a generalization of the typed arrays API entitled typed objects. The typed objects API is slated for inclusion in the upcoming ES7 standard. The API gives users the ability to define named types, making typed arrays much easier to work with. In particular, it is often trivial to replace uses of existing JavaScript objects with typed objects, resulting in better memory consumption and more predictable performance. The advantages of the typed object specification go beyond convenience, however. By supporting opacity---that is, the ability to deny access to the raw bytes of a typed object---the new typed object specification makes it possible to store objects as well as scalar data and also enables more optimization by JIT compilers.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call