[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Wed, 26 Mar 2014 10:02:36 +0100
On 23/03/2014 07:09, Jeremy Ong wrote:
> Many binary protocols are more easily expressible with raw binary than
> hex. This is because, to save space, single bits are often used to
> represent something (possibly a continuation bit), thus allowing a
> tighter packing.
>
Yep, that was, more or less, the use case I had in mind.
also @steve:
with the introduction of bitwise ops and 64bit integers Lua becomes more
attractive for bit fiddling. Packing binariy numbers in hex is useful
IMHO only when the individual bits have no specific meaning.
When you come to representing status registers of devices, complex
protocols and so on, being able to express them explicitly enhances
readability and documentation.
As you point out, you can exploit Lua syntax and function calls for that
(and also for the digit separator I proposed), but having that
feature at parsing or lexing level probably adds very few C lines to Lua
code and allows using that feature with less fuss in embedded devices or
in computationally-constrained contexts.
Of course YMMV.
Cheers.
-- Lorenzo
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments