lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


When porting between any two platforms or languages, the logic of basic programming is typically not the issue.  Computer languages are strictly specified, so translation is exact.   The problem is always features that are unique in one language and not the other.

Python supports many more packages in it's base instantiation than Lua. For example consider sockets, a part of the basic Python for quite some time, but in Lua there is LuaSocket that might be considered a deFacto Lua target, but then I see a discussion on this list of alternates at least once every 6 months :)

Similarly, Python has some language features, that while not typically used in simple scripts, don't have a direct analog in Lua.

So without an examination of the style of Python programming and its package dependencies the viability of moving it to Lua efficiently even with the assistance of some sort of translator like the one you cite, is not  a simple question. You have not described the Python you want to translate and why you hope it would be better suited as a Lua?

Generally any automated translation loses its maintainability.
Even poorly written programs written by humans are more easily understood by other humans than programs written by machines. 
Computer languages are humans communicating what they want a computer to do to each other, computers only understand binary :)         

Brian


On Thu, 28 Jan 2021 at 22:29, 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
Hi, list

Is it possible to perfectly convert the Python script to Lua script?
The script that contains peripheral operations is not to be considered.

I find an open source project(i.e
https://github.com/dmitrii-eremin/python-lua) which may achieve this
goal, but it seems not been maintained anymore since 2017.


Best regards
sunshilong