Wireshark-dev: Re: [Wireshark-dev] Move to Lua 5.3/5.4?

From: João Valverde <j@xxxxxx>
Date: Mon, 23 May 2022 19:37:05 +0100


On 23/05/22 18:03, Gerald Combs wrote:
On 5/23/22 6:57 AM, João Valverde wrote:


On 23/05/22 14:01, João Valverde wrote:
With Wireshark 4.0 there is an opportunity to make more sweeping changes. One of those is moving to Lua 5.3 or 5.4 (and only one of those).

Lua 5.3 has some important enhancements (bit ops, 64 bit integers and a basic utf-8 library).

Lua 5.4 introduces a new garbage collector.

New Lua minor versions are not 100% backward-compatible so some amount of breakage for existing Lua code is to be expected when moving from Wireshark 3.6 to 4.0, if this move goes ahead.


Note: Code using lua_bitop will have to be converted to native Lua bitwise operators. There is no compatibility provided for that.

Is forward and backward compatibility a matter of checking Lua's _VERSION global, e.g.

    if (_VERSION == "Lua 5.1") then
        ...
    else
        ...
    end

? If so, it would probably be useful to provide an example somewhere.

I'm not sure how far that simple strategy will go (not very?). Maybe someone else with more experience using multiple Lua versions can answer that.