lua-users home
lua-l archive

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


On Fri, Jan 29, 2021 at 4:29 AM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:

> Is it possible to perfectly convert the Python script to Lua script?

Unless you define "perfectly convert", we do not know what you mean.

If that means "obtain code in Lua that does what the code in Python
does", yes, in theory it is possible, but it may need some supporting
C-libraries.

In practice, probably not trivial, and a major consideration would be
the need (or not) to use Python's standard or external libraries.

If the Python code runs embedded in some custom environment (i.e., not
the stock command-line interpreter), then one would also have to
consider the need (or not) to wrap the Lua VM in a Python-compatible
API/ABI.

Cheers,
V.