Skip to content

Some questions about the new Luau support #136

Answered by khvzak
setzer22 asked this question in Q&A
Discussion options

You must be logged in to vote

How is this userdata emulation performed? Is there going to be a significant performance hit when using userdata with Luau?

Not userdata itself, but associated uservalues are emulated using the registry and weak tables.
Uservalue is a custom data attached to userdata via set_user_value.
This is how it's emulated
It's definitely slower than in Lua 5.4, but still in my opinion very nice feature to have.

Is there no require support in luau?

Yes, Luau does not support modules out of the box (as I see the Luau code).
They emulated require in the CLI repl program here

And in that case, did you add some sort of Rust function to replace it?

Yep, the function I added

What are the other adap…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by setzer22
Comment options

You must be logged in to vote
1 reply
@khvzak
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants