Conversation
|
Hello, you're supposed to add a link to the markdown preview in your fork to make it easier to read, for example: ( A problem right now is that the bytecode compiler does not actually run Luau's type inference (for performance reasons, I've heard, but the type system also has its own bugs that Native Codegen already has to manage fallbacks for). It does not know what the type of a value is, frequently unless that value is a local that is never re-assigned or a constant; local x = 10
x = 5
return _G[x] --> `GETTABLE` and not `GETTABLEN`This seemed like it may be a barrier for this feature, which is why I'm pointing it out. |
|
I don't really see the point in reserving Structs are also not that useful without pointers, which Luau will never get because completely different semantics to a low level language like C. Dont get me wrong, tables are slower than this approach but again, its probably a few microseconds between reading bytes out of a buffer vs indexing a table, and this kind of performance is only really needed if you're writing code where performance is of the upmost important, which in 99% of places, isn't. |
"You can already do it manually" is not an argument against syntax sugar. It is an argument against most language features. |
(Rendered)
Adds compiler-only struct syntax as sugar over buffer serialization.
This proposal introduces no runtime or VM changes and compiles entirely to existing buffer operations.