User:SuzannaLinn Resident/LuaFuture

From Second Life Wiki
< User:SuzannaLinn Resident
Revision as of 03:55, 30 September 2024 by SuzannaLinn Resident (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Future

What the future holds for scripting in SL?

Let's look at some questions that we could have in mind about the future...


When will Lua be available?

Nobody knows.

The implementacion of Luau for SL is entering the testing phase. This testing is in three stages, in the beta grid:

- 1) Scripts will compile and run in LSL code as always, and at the same time will be compiled and tested in Luau code.

- 2) Scripts will compile and run in Luau code.

- 3) We will have Luau and LSL to choose.

Depending on how many issues appear along the testing, the process will take more or less, so not even the Lindens really now.


Will LSL scripts benefit from being compiled to Luau?

Yes.

Lua optimizes the code better than LSL, improving execution time and reducing memory usage, and also uses less memory to store the strings.

The LSL scripts will run faster and we will have more free memory.


Will Lua scripts have more memory?

Not for the moment.

Scripts will stay at 64k, but Lua’s efficiency means we can achieve more within the same memory constraints.


Will LSL continue to exist?

Yes.

For many years, perhaps forever.


Will LSL receive updates with new functions?

Yes... with a very big "but".

New functions will be added to both languages.

It's not doing the work twice. LL functions are written in C++ and they can be linked to both languages

The big "but" is that new functions will be designed with Lua in mind. And Lua has more types of data.

The functions with data types compatible with LSL will be added, the others will not.


Will there be any way to use the functions not added in LSL?

In some cases... but not easily.

A script can be written in only one language. But in the same object we can have scripts in LSL and scripts in Lua.

A LSL script could send data using linked messages to a Lua script that calls the function. Only if the parameters of the function are tables, not functions or objects.


Will there be a translator or transpiler to convert LSL source code into Lua source code?

Likely.

It seems that Lindens have no plans about it, but it could be added to other viewers. And if it is not there, several people, including me, will be working on it.


Will we have to move to Lua?

No.

If you feel that you need more functionalities, you will move to Lua. If you are comfortable in LSL, you can choose to stay in LSL.


Should we stop learning LSL and wait for Lua?

No.

If you are at an intermediate level, you are learning ll functions. They will be exactly the same in Lua. It's a knowledge useful 100%.

If you are a beginner, you are mostly learning programming skills. Also useful 100% for Lua and for any other programming language.


Will LuaSL be updated to the new versions of Luau?

Yes.

Luau is designed to be embbeded easily and the changes required for the SL platform can be added to a new version of Luau with moderate difficulty.