lua-users home
lua-l archive

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


As a side note, incremental improvements have been made to the C API. For example, functions which retrieved things from tables used to be `void` before. Now, they return type information in an "int" for what they retrieve, saving a good bit of repeated performance loss from the operation (death by 10000 cuts, etc.).

My C API wrapper still doesn't take advantage of this because LuaJIT and Lua 5.1 are still so wildly popular, but maybe one day LuaJIT and friends will move onto Lua 5.3 proper and we'll have a real time to migrate to take advantage of these new APIs!

On Fri, May 17, 2019 at 12:24 PM Dirk Laurie <dirk.laurie@gmail.com> wrote:
Op Vr. 17 Mei 2019 om 17:14 het Jim <djvaios@gmail.com> geskryf:
>
> when looking at Lua's C API i wondered why many of the API functions
> do not return a result where that would make sense and just return
> "void" (i. e. nothing), for example:

TL;DR

The Lua API has evolved incrementally over over twenty years.
Compatibility as far as possible with the previous version seems to be
a design goal. Changes similar to what you propose have occasionally
been made when the authors of the code needed the functionality,
usuallly with a change in the name.

-- Dirk