├── .gitignore ├── LICENSE ├── README.md └── examples ├── functions.png ├── operators.png └── types.png /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Byte-compiled Python files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # Ignore lua libraries 8 | lua/ 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Christian Vallentin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | **Status:** In development. 3 | 4 | *Information is chronologically added to this README.md file. When enough is implemented 5 | and fleshed out, then the library will be released.* 6 | 7 | 8 | # PyLua - Python into Lua 9 | 10 | [PyLua][PyLua] is a [source-to-source compiler][ss-compiler] 11 | that compiles [Python][Python] into [Lua][Lua]. 12 | 13 | *[PyLua][PyLua] is developed and tested using Python 3.5.1, 14 | Lua 5.1 and Lua 5.2.* 15 | 16 | 17 | ## Supported Functionality 18 | 19 | *The following list, is the features that __currently__ can be successfully 20 | translated from [Python][Python] to [Lua][Lua].* 21 | 22 | *Features in development has a strike-through.* 23 | 24 | - Variables 25 | - ~~Global & Local Variables (Differentiation)~~ 26 | - [Types](#types) 27 | - [Operators](#operators) 28 | - [Functions](#functions) 29 | - Nested Functions 30 | - ~~Classes~~ 31 | - ~~Importing~~ 32 | 33 | 34 | ### Types 35 | 36 | *Supported [Python][Python] types, that __currently__ can be successfully 37 | translated from [Python][Python] to [Lua][Lua].* 38 | 39 | #### Example - Python (left), Lua (right) 40 | 41 | *Excluding functions.* 42 | 43 | ![Supported Python Types](examples/types.png) 44 | 45 | 46 | ### Operators 47 | 48 | *Supported [Python][Python] operators, that __currently__ can be successfully 49 | translated from [Python][Python] to [Lua][Lua].* 50 | 51 | - Arithmetic (`+`, `-`, `*`, `/`, `%`, `**`, `//`) 52 | - Comparison (`==`, `!=`, `<>`, `>`, `<`, `>=`, `<=`) 53 | - Assignment (`=`, `+=`, `-=`, `*=`, `/=`, `%=`, `**=`, `//=`) 54 | - Bitwise (`~`, `&`, `|`, `^`, `<<`, `>>`) 55 | - Logical (`not`, `and`, `or`) 56 | - Membership (`in`, `not in`) 57 | - Identity (`is`, `is not`) 58 | 59 | #### Example - Python (left), Lua (right) 60 | 61 | ![Supported Python Operators](examples/operators.png) 62 | 63 | 64 | ### Functions 65 | 66 | *Supported [Python][Python] function declarations, that __currently__ can be successfully 67 | translated from [Python][Python] to [Lua][Lua].* 68 | 69 | Note that while [Python][Python] supports multiple `*args` and `**kwargs` in function declarations, 70 | [Lua][Lua] does not. [Lua][Lua] doesn't as it represents varargs with `...` (which is unnamed). 71 | 72 | #### Example - Python (left), Lua (right) 73 | 74 | ![Supported Python Function Declarations](examples/functions.png) 75 | 76 | 77 | ### License 78 | 79 | This module is shared under the MIT license, and is therefore free to use, share, distribute and modify. 80 | See [LICENSE](https://github.com/MrVallentin/PyLua/blob/master/LICENSE) for more details. 81 | 82 | 83 | [PyLua]: https://github.com/MrVallentin/PyLua 84 | 85 | [Python]: https://www.python.org 86 | [Lua]: http://www.lua.org 87 | 88 | [ss-compiler]: https://en.wikipedia.org/wiki/Source-to-source_compiler 89 | -------------------------------------------------------------------------------- /examples/functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vallentin/PyLua/84422a1953f1be3eb7d9b840cd5fb28c5ffd70ad/examples/functions.png -------------------------------------------------------------------------------- /examples/operators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vallentin/PyLua/84422a1953f1be3eb7d9b840cd5fb28c5ffd70ad/examples/operators.png -------------------------------------------------------------------------------- /examples/types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vallentin/PyLua/84422a1953f1be3eb7d9b840cd5fb28c5ffd70ad/examples/types.png --------------------------------------------------------------------------------