[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1565824.1565828acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Faster than C#: efficient implementation of dynamic languages on .NET

Published: 06 July 2009 Publication History

Abstract

The Common Language Infrastructure (CLI) is a virtual machine expressly designed for implementing statically typed languages such as C#, therefore programs written in dynamically typed languages are typically much slower than C# when executed on .NET.
Recent developments show that Just In Time (JIT) compilers can exploit runtime type information to generate quite efficient code. Unfortunately, writing a JIT compiler is far from being simple.
In this paper we report our positive experience with automatic generation of JIT compilers as supported by the PyPy infrastructure, by focusing on JIT compilation for .NET. Following this approach, we have in fact added a second layer of JIT compilation, by allowing dynamic generation of more efficient .NET bytecode, which in turn can be compiled to machine code by the .NET JIT compiler.
The main and novel contribution of this paper is to show that this two-layers JIT technique is effective, since programs written in dynamic languages can run on .NET as fast as (and in some cases even faster than) the equivalent C# programs.
The practicality of the approach is demonstrated by showing some promising experiments done with benchmarks written in a simple dynamic language.

References

[1]
D. Ancona, M. Ancona, A. Cuni, and N. Matsakis. RPython: a Step Towards Reconciling Dynamically and Statically Typed OO Languages. In OOPSLA 2007 Proceedings and Companion, DLS'07: Proceedings of the 2007 Symposium on Dynamic Languages, pages 53--64. ACM, 2007.
[2]
D. Ancona, C. F. Bolz, A. Cuni, and A. Rigo. Automatic generation of JIT compilers for dynamic languages in .NET. Technical report, DISI, University of Genova and Institut für Informatik, Heinrich-Heine-Universität Düsseldorf, 2008.
[3]
C. F. Bolz, A. Cuni, A. Rigo, and M. Fijalkowski. Tracing the meta-level: Pypy's tracing jit compiler. Submitted to ICOOOLPS'09.
[4]
C. F. Bolz, A. Kuhn, A. Lienhard, N. D. Matsakis, O. Nierstrasz, L. Renggli, A. Rigo, and T. Verwaest. Back to the future in one week - implementing a smalltalk vm in PyPy. In Self-Sustaining Systems, First Workshop, S3 2008, Potsdam, Revised Selected Papers, volume 5146 of Lecture Notes in Computer Science, pages 123--139, 2008.
[5]
M. Chang, M. Bebenita, A. Yermolovich, A. Gal, and M. Franz. Efficient just-in-time execution of dynamically typed languages via code specialization using precise runtime type inference. Technical report, Donald Bren School of Information and Computer Science, University of California, Irvine, 2007.
[6]
A. Gal and M. Franz. Incremental dynamic code generation with trace trees. Technical report, Donald Bren School of Information and Computer Science, University of California, Irvine, Nov. 2006.
[7]
A. Gal, C. W. Probst, and M. Franz. HotpathVM: an effective JIT compiler for resource-constrained devices. In Proceedings of the 2nd international conference on Virtual execution environments, pages 144--153, Ottawa, Ontario, Canada, 2006. ACM.
[8]
U. Hölzle, C. Chambers, and D. Ungar. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In Proceedings of the European Conference on Object-Oriented Programming, pages 21--38. Springer-Verlag, 1991.
[9]
U. Hölzle and D. Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation, pages 326--336, New York, NY, USA, 1994. ACM.
[10]
A. Rigo. Representation-based just-in-time specialization and the psyco prototype for python. In PEPM, pages 15--26, 2004.
[11]
A. Rigo and C. F. Bolz. How to not write Virtual Machines for Dynamic Languages. In Proceeding of Dyla 2007 (to appear), pages -, 2007.
[12]
A. Rigo and S. Pedroni. PyPy's approach to virtual machine construction. In OOPSLA Companion, pages 944--953, 2006.
[13]
A. Rigo and S. Pedroni. JIT compiler architecture. Technical Report D08.2, PyPy Consortium, 2007. http://codespeak.net/pypy/dist/pypy/doc/indexreport.html.

Cited By

View all
  • (2014)Just-in-time value specializationComputer Languages, Systems & Structures10.1016/j.cl.2013.11.00140:2(37-52)Online publication date: Jul-2014
  • (2010)SPURACM SIGPLAN Notices10.1145/1932682.186951745:10(708-725)Online publication date: 17-Oct-2010
  • (2010)SPURProceedings of the ACM international conference on Object oriented programming systems languages and applications10.1145/1869459.1869517(708-725)Online publication date: 17-Oct-2010
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Other conferences
ICOOOLPS '09: Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems
July 2009
73 pages
ISBN:9781605585413
DOI:10.1145/1565824
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]

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 06 July 2009

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Conference

ECOOP '09

Acceptance Rates

Overall Acceptance Rate 11 of 14 submissions, 79%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2014)Just-in-time value specializationComputer Languages, Systems & Structures10.1016/j.cl.2013.11.00140:2(37-52)Online publication date: Jul-2014
  • (2010)SPURACM SIGPLAN Notices10.1145/1932682.186951745:10(708-725)Online publication date: 17-Oct-2010
  • (2010)SPURProceedings of the ACM international conference on Object oriented programming systems languages and applications10.1145/1869459.1869517(708-725)Online publication date: 17-Oct-2010
  • (2009)Tracing the meta-levelProceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems10.1145/1565824.1565827(18-25)Online publication date: 6-Jul-2009

View Options

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