ABSTRACT
Microsoft's Common Language Runtime offers a target environment for compiler writers that provides a managed execution environment and type system, garbage collection, access to OS services, multithreading, and a Just-In-Time compiler. But the CLR uses a statically typed intermediate language, which is a problem for efficient compilation of dynamically typed languages in general, and the Lua language in particular.
This paper presents a way to implement a Lua compiler for the CLR that generates efficient code. The code this compiler generates outperforms the same code executed by the Lua interpreter and similar code generated by Microsoft's IronPython compiler. It approaches the performance of Lua code compiled to native code by LuaJIT.
- A. L. de Moura, N. Rodriguez, and R. Ierusalimschy. Coroutines in lua. Journal of Universal Computer Science, 10(7):910--925, 2004.Google Scholar
- M. Hammond. Python for .NET: Lessons Learned, 2000. Technical report by ActiveState, not available online at the time of this paper's writing.Google Scholar
- 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 Press. Google Scholar
Digital Library
- J. Hugunin. Ironpython: A fast python implementation for .net and mono. In Proceedings of PyCon DC 2004, 2004. Available at http://www.python.org/pycon/dc2004/papers/9.Google Scholar
- J. Hugunin. A Dynamic Language Runtime (DLR), 2007. Available at http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx.Google Scholar
- R. Ierusalimschy, L. H. de Figueiredo, and W. Celes. The evolution of lua. In HOPL III: Proceedings of the third ACM SIGPLAN conference on History of programming languages, pages 2-1--2-26, New York, NY, USA, 2007. ACM Press. Google Scholar
Digital Library
- R. Ierusalimschy, L. H. Figueiredo, and W. Celes. Lua 5.1 Reference Manual. Technical Report 14/03, PUC-Rio, 2006. Available at http://www.lua.org/manual/5.1.Google Scholar
- F. Mascarenhas and R. Ierusalimschy. Luainterface: Scripting the .net clr with lua. Journal of Universal Computer Science, 10(7):892--909, 2004.Google Scholar
- F. Mascarenhas and R. Ierusalimschy. Running lua scripts on the clr through bytecode translation. Journal of Universal Computer Science, 11(7):1275--1290, 2005.Google Scholar
- Microsoft. ECMA C# and Common Language Infrastructure Standards, 2005. Available at http://msdn.microsoft.com/net/ecma/.Google Scholar
- M. Pall. The LuaJIT project, 2007. Available at http://luajit.org/.Google Scholar
- G. Pettyjohn, J. Clements, J. Marshall, S. Krishnamurthi, and M. Felleisen. Continuations from generalized stack inspection. In ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, pages 216--227, New York, NY, USA, 2005. ACM Press. Google Scholar
Digital Library
Index Terms
Efficient compilation of Lua for the CLR






Comments