Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2661088.2661095acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Typed objects in JavaScript

Published: 14 October 2014 Publication History

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.

References

[1]
Are we fast yet? http://arewefastyet.com.
[2]
ctypes-A foreign function interface for Python. http://docs.python.org/2/library/ctypes.html.
[3]
Draft Specification for ES.next (Ecma-262 Edition 6). http://wiki.ecmascript.org/.
[4]
Java Native Access. https://github.com/twall/jna.
[5]
JSctypes. https://wiki.mozilla.org/JSctypes.
[6]
LibFFI. https://sourceware.org/libffi/.
[7]
Mandreel. http://www.mandreel.org.
[8]
The Python Data Model, Section 3.4.2.4. http://docs.python.org/2/reference/datamodel.html.
[9]
Alon Zakai et al. Emscripten. http://www.emscripten.org.
[10]
J. Dolby. Automatic Inline Allocation of Objects. In Programming Language Design and Implementation, PLDI '97, pages 7--17, New York, NY, USA, 1997. ACM. ISBN 0-89791-907-6.
[11]
B. Hackett and S.-y. Guo. Fast and Precise Hybrid Type Inference for JavaScript. In Programming Language Design and Implementation, PLDI '12, pages 239--250, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1205-9.
[12]
T. Jim, J. G. Morrisett, D. Grossman, M. W. Hicks, J. Cheney, and Y. Wang. Cyclone: A Safe Dialect of C. In USENIX Annual Technical Conference, ATEC '02, pages 275--288, Berkeley, CA, USA, 2002. USENIX Association. ISBN 1-880446-00-6.
[13]
A. W. Keep and R. K. Dybvig. Ftypes: Structured foreign types. In Scheme 2011: Workshop on Scheme and Functional Programming, pages 57--65, 2011.
[14]
The Khronos Group. Typed Array Specification v1.0. https://www.khronos.org/registry/typedarray/specs/1.0/, February 2011.
[15]
Veldema, Ronald and Jacobs, Ceriel J. H. and Hofman, Rutger F. H. and Bal, Henri E. Object Combining: A New Aggressive Optimization for Object Intensive Programs: Research Articles. Concurr. Comput. : Pract. Exper., 17(5-6):439--464, Apr. 2005. ISSN 1532-0626.
[16]
C. Wimmer and H. Mössenböck. Automatic Feedback-directed Object Inlining in the Java Hotspot™ Virtual Machine. In Virtual Execution Environments, VEE '07, pages 12--21, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-630-1.

Cited By

View all
  • (2023)The Next Evolution of Web Browser Execution Environment Performance2023 International Conference on Artificial Intelligence, Big Data, Computing and Data Communication Systems (icABCD)10.1109/icABCD59051.2023.10220564(1-7)Online publication date: 3-Aug-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
DLS '14: Proceedings of the 10th ACM Symposium on Dynamic languages
October 2014
160 pages
ISBN:9781450332118
DOI:10.1145/2661088
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 50, Issue 2
    DLS '14
    February 2015
    146 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2775052
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 14 October 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. javascript
  2. typed arrays
  3. typed objects

Qualifiers

  • Research-article

Conference

SPLASH '14
Sponsor:

Acceptance Rates

DLS '14 Paper Acceptance Rate 13 of 28 submissions, 46%;
Overall Acceptance Rate 32 of 77 submissions, 42%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)14
  • Downloads (Last 6 weeks)1
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2023)The Next Evolution of Web Browser Execution Environment Performance2023 International Conference on Artificial Intelligence, Big Data, Computing and Data Communication Systems (icABCD)10.1109/icABCD59051.2023.10220564(1-7)Online publication date: 3-Aug-2023

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media