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

Add more Lua libraries #246

Open
SolarcGit opened this issue Jun 13, 2023 · 14 comments
Open

Add more Lua libraries #246

SolarcGit opened this issue Jun 13, 2023 · 14 comments
Labels
Feature New feature to the engine Good First Issue An easy issue for new contributors QoL Quality of Life : Something that can improve users productivity

Comments

@SolarcGit
Copy link

SolarcGit commented Jun 13, 2023

We should consider adding the following libraries to the ScriptInterpreter.cpp:

  • sol::lib::package
  • sol::lib::coroutine
  • sol::lib::string
  • sol::lib::os
  • sol::lib::table
@SolarcGit SolarcGit added the Feature New feature to the engine label Jun 13, 2023
@adriengivry adriengivry changed the title Add more Lua libraries to make making easier ;P Add more Lua libraries Jun 14, 2023
@adriengivry adriengivry added QoL Quality of Life : Something that can improve users productivity Good First Issue An easy issue for new contributors labels Jun 14, 2023
@adriengivry
Copy link
Owner

Good point. We should also evaluate the consequences of adding these libraries:

  • Runtime overhead?
  • Loading times?

@SolarcGit
Copy link
Author

What these libraries add to the making of a game outweights the consequences In my opinion.
(I am pretty new though please keep that in mind)
Having these libraries, especially table, coroutine, string and os, would greatly help in developing a game.

@adriengivry
Copy link
Owner

What these libraries add to the making of a game outweights the consequences In my opinion. (I am pretty new though please keep that in mind) Having these libraries, especially table, coroutine, string and os, would greatly help in developing a game.

That's for sure! But it's important to gather factual data about the consequences of making such a change in order to make a more informed decision.

@SolarcGit
Copy link
Author

Yes opinion is not all. Sadly I dont know how to gather the data to find out if it would be detrimental to the performance. Is there any way I can push this?

@adriengivry
Copy link
Owner

Yes opinion is not all. Sadly I dont know how to gather the data to find out if it would be detrimental to the performance. Is there any way I can push this?

We should look into sol2 and see how they implemented lua libraries. Are these libraries dynamic loaded? Are there any requirements to include these libs? Compatibility issues? Maybe having some profiling data about compilation time and runtime performance with/without these libs would be good to have too. We should document all that in the pull request adding these libraries to Overload.

@SolarcGit
Copy link
Author

Is there any way I can help do that?

@adriengivry
Copy link
Owner

Is there any way I can help do that?

For sure! You can do this investigation process, do the change first (include the libs), and measure the performance impact (compilation and runtime), and document all that 👌

@SolarcGit
Copy link
Author

using sol2?

@adriengivry
Copy link
Owner

Overload is using sol2 for lua scripting yes

@SolarcGit
Copy link
Author

ok ok got it but where do I start?

@adriengivry
Copy link
Owner

ok ok got it but where do I start?

Make the requested change in ScriptInterpreter.cpp, and get some profiling data with VS. Dig into sol2 and investigate the implications of such a change.

@SolarcGit
Copy link
Author

can you show me how I can do the change?

@adriengivry
Copy link
Owner

m_luaState->open_libraries(sol::lib::base, sol::lib::math);

Read the documentation of the open_libraries function in sol2.

@SolarcGit
Copy link
Author

will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature to the engine Good First Issue An easy issue for new contributors QoL Quality of Life : Something that can improve users productivity
Projects
None yet
Development

No branches or pull requests

2 participants