Skip to content

Source-to-source compiler that compiles Python into Lua

License

Notifications You must be signed in to change notification settings

vallentin/PyLua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Status: In development.

Information is chronologically added to this README.md file. When enough is implemented and fleshed out, then the library will be released.

PyLua - Python into Lua

PyLua is a source-to-source compiler that compiles Python into Lua.

PyLua is developed and tested using Python 3.5.1, Lua 5.1 and Lua 5.2.

Supported Functionality

The following list, is the features that currently can be successfully translated from Python to Lua.

Features in development has a strike-through.

  • Variables
  • Global & Local Variables (Differentiation)
  • Types
  • Operators
  • Functions
  • Nested Functions
  • Classes
  • Importing

Types

Supported Python types, that currently can be successfully translated from Python to Lua.

Example - Python (left), Lua (right)

Excluding functions.

Supported Python Types

Operators

Supported Python operators, that currently can be successfully translated from Python to Lua.

  • Arithmetic (+, -, *, /, %, **, //)
  • Comparison (==, !=, <>, >, <, >=, <=)
  • Assignment (=, +=, -=, *=, /=, %=, **=, //=)
  • Bitwise (~, &, |, ^, <<, >>)
  • Logical (not, and, or)
  • Membership (in, not in)
  • Identity (is, is not)

Example - Python (left), Lua (right)

Supported Python Operators

Functions

Supported Python function declarations, that currently can be successfully translated from Python to Lua.

Note that while Python supports multiple *args and **kwargs in function declarations, Lua does not. Lua doesn't as it represents varargs with ... (which is unnamed).

Example - Python (left), Lua (right)

Supported Python Function Declarations

License

This module is shared under the MIT license, and is therefore free to use, share, distribute and modify. See LICENSE for more details.

About

Source-to-source compiler that compiles Python into Lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages