Compiling dynamic languages via statically typed functional languages

dc.contributor.advisorTaha, Waliden_US
dc.creatorBandyopadhyay, Rajarshien_US
dc.date.accessioned2011-07-25T01:37:57Zen_US
dc.date.available2011-07-25T01:37:57Zen_US
dc.date.issued2009en_US
dc.description.abstractDynamic languages enable rapid prototyping, but are generally not viewed as providing the best performance. As a result, software developers generally build a prototype in a dynamic language and then rewrite the application in C or Fortran for high performance. This costly rewriting step can be avoided by improving the performance of dynamic languages. Dynamic languages are usually interpreted for easier implementation. The traditional approach to improve their performance is to build an optimizing compiler. However, building a compiler from scratch is much more time-consuming than implementing an interpreter. Our thesis is that we can build effective compilers for dynamic languages by translating them into statically typed functional languages which have good compilers and automatic memory management. In particular, we believe that modern statically typed languages provide precise control over data representations, and come with runtime systems that have competitive performance. To investigate the viability of this approach, we have built a compiler for the dynamic language Python by translating it into the statically typed functional language OCaml. An interesting practical advantage of using modern statically typed functional languages is that they use Hindley-Milner type systems, which means that there is no need for the translation to construct type terms. We compare the performance of our implementation, Monty, with that of CPython, the reference Python implementation, and with Jython, a Java implementation of Python, using a suite of 370 benchmarks. Our experiments show that some programs compiled using our approach run up to 4.6 times faster than CPython. However, due to a number of engineering reasons, some programs also run significantly slower than CPython. We pinpoint the specific causes of performance degradation and assess the potential for removing these causes in future work. Our implementation is significantly faster than Jython, up to a factor of 100 in some cases. A by product of our research is a proposal for an improved array copying implementation in OCaml.en_US
dc.format.mimetypeapplication/pdfen_US
dc.identifier.callnoTHESIS COMP.SCI. 2009 BANDYOPADHYAYen_US
dc.identifier.citationBandyopadhyay, Rajarshi. "Compiling dynamic languages via statically typed functional languages." (2009) Diss., Rice University. <a href="https://hdl.handle.net/1911/61785">https://hdl.handle.net/1911/61785</a>.en_US
dc.identifier.urihttps://hdl.handle.net/1911/61785en_US
dc.language.isoengen_US
dc.rightsCopyright is held by the author, unless otherwise indicated. Permission to reuse, publish, or reproduce the work beyond the bounds of fair use or other exemptions to copyright law must be obtained from the copyright holder.en_US
dc.subjectComputer scienceen_US
dc.subjectApplied sciencesen_US
dc.titleCompiling dynamic languages via statically typed functional languagesen_US
dc.typeThesisen_US
dc.type.materialTexten_US
thesis.degree.departmentComputer Scienceen_US
thesis.degree.disciplineEngineeringen_US
thesis.degree.grantorRice Universityen_US
thesis.degree.levelDoctoralen_US
thesis.degree.nameDoctor of Philosophyen_US
Files
Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
3362128.PDF
Size:
2.9 MB
Format:
Adobe Portable Document Format