Contributor
Samuel Rowe

Module Statement and Automatic Pallene to Lua Translator


Mentors
Hugo Musso Gualandi, Gabriel Ligneul
Organization
LabLua

Pallene is a statically typed, ahead-of-time-compiled sister language to Lua, with a focus on performance. Programmers can use Pallene instead of C modules and LuaJIT to improve and gain a predictable run-time performance. Pallene achieves this by translating a statically typed compilation unit into a C source file, which is implicitly compiled in the background.

However, there are situations where removal of type annotations are useful.

  • The main premise of Pallene is that it is compatible with Lua. This compatibility is defined as removing type annotations from a Pallene program results in transforming it into a Lua program. A Pallene to Lua translator will allow us to check whether this property is still valid.
  • Provides greater portability, interoperability and integration with existing Lua codebase and tools.
  • The Pallene developers could check if the unit tests are obeying the "gradual guarantee".
  • In the benchmarks that do not use LuaJIT features, we could generate the Lua version of the code from the Pallene version.

With the help of the Pallene to Lua translator, users can remove Pallene type annotations to generate plain Lua.