Skip to content

Add 24-bit Integer Buffer Accessors (u24 / i24)#202

Closed
YarikSuperpro wants to merge 2 commits into
luau-lang:masterfrom
YarikSuperpro:int-24-buffer
Closed

Add 24-bit Integer Buffer Accessors (u24 / i24)#202
YarikSuperpro wants to merge 2 commits into
luau-lang:masterfrom
YarikSuperpro:int-24-buffer

Conversation

@YarikSuperpro
Copy link
Copy Markdown

@YarikSuperpro YarikSuperpro commented May 8, 2026

(Rendered)
This proposal adds u24 and i24 read/write support to the buffer library, enabling native 24-bit integer serialization for compact data representations such as RGB colors, small IDs, and packed binary formats.

The goal is to reduce the need for manual bit packing or multi-byte composition in common serialization-heavy code paths, while improving readability and reducing boilerplate in performance-sensitive systems.

No changes to language syntax or VM behavior are introduced; this is a pure extension of the buffer API.

Copy link
Copy Markdown
Contributor

@PhoenixWhitefire PhoenixWhitefire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your RFC is supposed to be in the docs/ directory, please move it there.

@vegorov-rbx
Copy link
Copy Markdown
Collaborator

Duplicate of #32

Also note that for custom widths, we already introduced readbits and writebits.

@vegorov-rbx vegorov-rbx added the duplicate This issue or pull request already exists label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants