lua-users home
lua-l archive

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

> Does anyone know how hard that would be? Would it be feasible to use
> existing Python header files or would it be best to write our own
> headers? I can see good reasons both ways. See below.

I'd have to think further about this to give you a more realistic
opinion, but I belive it shouldn't be too hard to wrap the basic API
(refcounting, module declaration, etc) on top of lua. OTOH, if you have
in mind implementing a complete API, including C classes, descriptors,
etc, it will most certainly be a huge work.

> The goal would be to provide a C library that fools existing Python
> modules into believing they are running over Python, when they would
> be actually running over Lua. This would allow Python modules to
> become Lua libraries automagically. The motivation is the large number
> of Python modules that already exist. Is this perception true? Are
> there lots of useful Python modules written in C?.

Yes, there are. OTOH, I think a better question would be: are there lots
of useful Python modules implemented using the subset of the API which
is going to be accepted by Lua?

> If we only support binary Python modules, then we wouldn't have to
> provide header files to compile Python modules, but we'd still need
> some headers to compile the library. In this case, using the original
> Python headers would convenient but would also imply that we should
> use the same struct definitions.
> If someone that knows Python gives me a push and some help, I'd like
> to try.  Everyone is welcome to join this, of course.

I have some experience in the Python core, and can help you if needed.

Gustavo Niemeyer