Skip to content

Questions about python-lua #4

Open

Description

@inceptorprogrammer

Why is lua a dynamic dependency of python-lua when it could be a static one for compilation if i am correct?

why was some code converted to C and C++?

Activity

  1. inceptorprogrammer commented on May 31, 2025

    @inceptorprogrammer
    Author

    Oh yeah i wonder if it would be possible to support luau and maybe luajit

  2. wijnen commented on Jun 7, 2025

    @wijnen
    Owner

    Hi,

    I'm not sure what you mean by dynamic or static dependency. Can you explain?

    When you reported this, I was in the process of converting the code to C++. Later, there were strange bugs and I wasn't sure if it was due to C++ not being supported, so I changed it to C. By now, the whole project is converted to C.

    There are two reasons for it: it has better performance, and the Lua API is defined in C. I had to hack around that to access the library directly from Lua (because it did not give me access to preprocessor macros), which made it fragile; it could stop working due to a change in Lua that wasn't a change in its interface. That is no longer the case now that it uses the documented interace.

    I didn't test other Lua variants, but I wouldn't be surprised if they work. You'd have to try.

  3. inceptorprogrammer commented on Jun 7, 2025

    @inceptorprogrammer
    Author

    a static dependency is a dependency that comes bundled with the program or source code in this case module.c and function.c

    a dynamic dependency is a dependency that needs to be added or acquired for example PHP or even python itself

    a dependency is something a program or library or source code needs to work properly for example module.c and function.c

  4. inceptorprogrammer commented on Jun 7, 2025

    @inceptorprogrammer
    Author

    Hi,

    I'm not sure what you mean by dynamic or static dependency. Can you explain?

    When you reported this, I was in the process of converting the code to C++. Later, there were strange bugs and I wasn't sure if it was due to C++ not being supported, so I changed it to C. By now, the whole project is converted to C.

    There are two reasons for it: it has better performance, and the Lua API is defined in C. I had to hack around that to access the library directly from Lua (because it did not give me access to preprocessor macros), which made it fragile; it could stop working due to a change in Lua that wasn't a change in its interface. That is no longer the case now that it uses the documented interace.

    I didn't test other Lua variants, but I wouldn't be surprised if they work. You'd have to try.

    as far as I know all lua variants are based on lua 5.1 so lua 5.1 compatibility is important for working with other lua variants such as luau and luajit that is why I was testing if the lua 5.1 testsuite worked

  5. inceptorprogrammer commented on Jun 7, 2025

    @inceptorprogrammer
    Author

    lua could be a static dependency if i'm correct since all you have to do if i'm correct is include the lua header (lua.h) and other files

    many programs already include lua as a static dependency so it is possible if I am correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions