lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Just in case anyone cares...

I hugely underestimated the number and size of error messages in Lua. I
naively guessed there would be about 15 error messages in the code of
about 20 characters each, making about 300 bytes. Wrong!

A little investigation has shown that the Lua 5.0 source actually makes 33
distinct calls to luaG_runerror. The longest messages such as "attempt to
yield across metamethod/C-call boundary" are about 50 characters in length
(not counting the %s and %d placeholders).

In total, the strings passed to luaG_runerror account for 903 bytes of
storage or about 3.5% of the minimal Lua core (according to the slightly
old LTN 2).

&.