Title
An efficient approach for accessing C data structures from JavaScript
Abstract
We present a novel approach for allowing JavaScript applications to access C data structures without performance overhead or additional boiler plate code. Dynamic languages such as JavaScript do not have a fixed memory layout for run-time data nor do they allow low-level memory accesses, which makes interoperability with languages such as C hard. Our approach allows JavaScript applications to transparently use C pointers as receivers of object accesses or array accesses, thus the programmer can access C data structures as if they were JavaScript objects. We describe how we modified an existing JavaScript interpreter so that it generates different access operations at run time depending on whether the receiver is a JavaScript object or a C pointer. We evaluated our prototype using benchmarks that measure array access performance. The evaluation of our JavaScript interpreter shows that using C arrays from within JavaScript is on average 27% faster than using regular JavaScript arrays and 19% faster than using Typed Arrays.
Year
DOI
Venue
2014
10.1145/2633301.2633302
ICOOOLPS@ECOOP
Keywords
Field
DocType
typed arrays,run-time environments,virtual machine,compilers,optimization,c,interpreters,language interoperability,language implementation,javascript
Pointer (computer programming),Data structure,Programming language,Computer science,Unobtrusive JavaScript,Callback,Language interoperability,JavaScript syntax,Operating system,JavaScript,Primitive data type
Conference
Citations 
PageRank 
References 
5
0.45
2
Authors
4
Name
Order
Citations
PageRank
Matthias Grimmer1636.19
Thomas Würthinger239625.63
Andreas Wöß350.45
Hanspeter Mössenböck478188.17