Add reference/copy support #882
prooheckcp
started this conversation in
Ideas
Replies: 2 comments
-
I don't this matches luau's fundamentals very well. Luau is supposed to be a simple and memory-safe scripting language, so introducing memory management features as such makes it much more complicated than it needs to be. Furthermore, luau is a scripting language (like Python), not a systems programming language (like C#). |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think this is something that's possible to implement in Luau. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I was wondering if it would be possible for Luau at some point to have the same features as most typed languages (e.g C#) where you can declare things by reference or copy?
It would allow us to optimize functions and make it easier to reuse variables without copying them around or wrapping them in a table to become by reference. Currently, if I want something by reference I'm forced to use a table. If I want to reuse any other type it always ends up making a copy of it which isn't the optimal solution, especially for memory management.
Having this as an optional thing just like C# would most likely be the best solution for this.
Beta Was this translation helpful? Give feedback.
All reactions