Unions for instructions #248
jdpatdiscord
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
@zeux I don't think you were notified. Should I move this to an issue for better visibility? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When looking at the Luau source back when it released around Nov 3rd, I was surprised to see that Luau did not use unions for storing instructions, when I had successfully used unions in my own private projects to represent them.
My findings were that despite different compilers having limitations to how well a union could be packed with something as complicated as a Luau instruction, it ended up being "good enough" where it was able to encode every possible format into a 32-bit union, except for one minor inconvenience.
Unions would be a notable improvement in code cleanliness, and I'm happy to share my findings on union packing Luau instructions specifically if it is an interest. (clang/msvc/gcc)
Beta Was this translation helpful? Give feedback.
All reactions