Mathematik  |  Informatik

 

Max Prihodko, 2006 | Lincoln, USA / Luzern

 

Lua++ is a fully-featured new programming language for a wide range of applications that is fast, lightweight, and energy-efficient. The language was created with the goal of increasing software efficiency, decreasing barriers to adoption on low-cost hardware platforms, and providing a tool for learning advanced computer science concepts. Borrowing from several modern languages, Lua++ adds proper object-oriented programming with a class hierarchy and encapsulation, generics, type annotations, events, attributes, and much more. Overcoming the limitations of its famous predecessor, Lua++ is suitable for use by teams of developers in large cross-platform projects. The author designed the syntax, built a modern optimizing compiler, modified the Lua VM to support a custom bytecode format, and implemented specialized optimizations for Lua++.

Introduction

The paper focuses on addressing the challenge of eliminating many of Lua++’s predecessor’s shortcomings by evaluating and implementing new, modern language features while keeping Lua++ familiar and retaining backward compatibility.

Methods

The research phase of this project consisted of studying many papers and online discussions to identify Lua’s shortcomings, as well as analyzing the landscape of new programming languages, such as Rust, Kotlin, and Scala, including recently adopted enhancements to established languages, such as Python, C++, and Java. Respective additions to the language grammar and structure were then implemented, such as proper object-oriented programming with a class hierarchy and encapsulation, generics, type annotations, events, attributes, and much more. The compiler follows a classic structure (lexer, parser, intermediate representation, etc.) and generates bytecode in both the legacy and a custom format for an enhanced Lua++ virtual machine to execute.

Results

The aforementioned language features along with various optimizations were implemented in the Lua++ compiler and virtual machine, achieving our primary goal of addressing Lua’s shortcomings, as well as improving its efficiency and runtime performance. Based on performance tests consisting of several commonly used benchmarks, Lua++ is four to 25 times faster than classic Lua. The implementation has been open-sourced and is available on GitHub.

Discussion

While many projects attempted to improve Lua, this is the only project that significantly extends and enhances the syntax. Lua++ can be compared to Luau, a similar project developed for the Roblox game platform. The major difference is that Luau is geared toward game development, while Lua++ targets a wide range of uses. Despite its many advantages, Lua++ can be further improved. Developing a native backend and more powerful optimizations would increase runtime performance substantially and make it easier to write platform-specific code. The current type interface can be extended by optional types and class interfaces. Furthermore, the addition of libraries, such as network sockets, would help broaden the applications of the language even further.

Conclusions

The goal of Lua++ was to provide an efficient and modern programming environment for the Lua ecosystem. This was accomplished by analyzing Lua’s shortcomings, extending the language with a plethora of new modern features such as proper object-oriented programming along with optional strict typing, and implementing an optimizing compiler and efficient VM. The work was then evaluated on a set of computational benchmarks that showed the benefits of Lua++ over its predecessor.

 

 

Würdigung durch den Experten

Michal Terepeta

The focus of the project is Lua++, a new programming language by Max Prihodko. It addresses the problem of evolving Lua in a way that preserves backwards compatibility, while improving its runtime efficiency as well as programmer’s productivity. The work spanned multiple areas, from identifying the shortcomings of Lua, through the design of new language features to address them, all the way to implementing a compiler and extending the Lua VM and its bytecode to improve the performance. The project is available on GitHub and has already led to interesting discussions within the Lua community.

Prädikat:

hervorragend

Sonderpreis «Summer School of Science» gestiftet von der Metrohm Stiftung

 

 

 

Lincoln Sudbury Regional High School, Sudbury, MA
Lehrer: Jérémie Aebischer