[HN Gopher] Compact Representations for Arrays in Lua [pdf]
___________________________________________________________________
Compact Representations for Arrays in Lua [pdf]
Author : tkhattra
Score : 33 points
Date : 2025-06-18 23:49 UTC (2 days ago)
(HTM) web link (sol.sbc.org.br)
(TXT) w3m dump (sol.sbc.org.br)
| kzrdude wrote:
| It was published in September 2024, so it's relatively recent.
| Jyaif wrote:
| Jesus christ, 40% waste in arrays that can be solved by using
| `__attribute__((packed))`.
|
| Irresponsible of them of not advertising this as an option in
| luaconf.h
| sfpotter wrote:
| Here's the rest of that paragraph for you:
|
| "However, this attribute is a gcc extension not present in ISO
| C. Moreover, even in gcc it is not guaranteed to work [3]. As
| portability is a hallmark of Lua, this almost magical solution
| is a no-go."
| Jyaif wrote:
| It works in gcc and LLVM, on both arm and x86, so I'd say
| conservatively that 90% of their users are covered.
| ufo wrote:
| This optimization might land in the next Lua release. More
| specifically, the "Reflected Arrays" version (Figure 6).
|
| https://github.com/lua/lua/blob/f71156744851701b5d5fabdda506...
___________________________________________________________________
(page generated 2025-06-21 23:00 UTC)