Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for requiring c libraries in scripts #4123

Open
zarstensen opened this issue Nov 6, 2023 · 1 comment
Open

Provide support for requiring c libraries in scripts #4123

zarstensen opened this issue Nov 6, 2023 · 1 comment
Assignees
Labels
feature Feature request, or something should be improved low priority scripting Related to scripting API

Comments

@zarstensen
Copy link

Currently, loading C or C++ shared libraries in scripts is not fully supported in Aseprite. It is possible to load these types of libraries on Windows if you fiddle with the package.cpath and package.searchers values, or load them directly using package.loadlib, however it would be ideal to fully support loading shared libraries out of the box. Additionally, it is impossible to load shared libraries on Linux or MacOS, as lua is not linked against 'dl' on these platforms.

Supporting loading shared libraries would enable development of more advanced scripts, as it would allow them to make use of features lua does not support (ex. multi threading), or allow usage of popular lua packages, which require shared libraries to function (ex. LuaSocket).

I would be able to open a PR of a possible implementation, if this feature is something you would like to see in Aseprite.

@dacap dacap added feature Feature request, or something should be improved scripting Related to scripting API triage labels Nov 28, 2023
@dacap dacap self-assigned this Nov 28, 2023
@dacap dacap changed the title [Feature Request] Provide support for requiring c libraries in scripts Provide support for requiring c libraries in scripts Dec 12, 2023
@dacap dacap removed the triage label Dec 12, 2023
@dacap
Copy link
Member

dacap commented Dec 12, 2023

Hi @zarstensen, actually the main issue with loading shared libraries are that 1) you have to highly trust the other party, and 2) we'd need to offer some kind of SDK to compile the libraries with the exact same Lua implementation.

At the moment this is low priority as we'd prefer to make the scripting Lua API bigger instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request, or something should be improved low priority scripting Related to scripting API
Projects
None yet
Development

No branches or pull requests

2 participants