[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available
- From: Jeremy Ong <jeremycong@...>
- Date: Sat, 22 Mar 2014 23:09:41 -0700
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
This is used, for example, in websocket code to indicate continuation
frames or signal the existence of an extension. It's also useful when
implementing protocol buffers (variable width integers in particular).
Unicode is, of course, the canonical example.
On Sat, Mar 22, 2014 at 10:58 PM, steve donovan
> On Sun, Mar 23, 2014 at 12:38 AM, Lorenzo Donati
> <firstname.lastname@example.org> wrote:
>> 1. Binary literals, such as 0b100101101, or something like that.
> Easy enough to write:
>> function B(b) return tonumber(b,2) end
> But it's true these are not literals and involve a function call. I
> don't know of the general usefullness; mostly binary is used for
> training and then people move over to the more compact hex.
>> 2. A not significant digit separator for better readability of long numbers:
> It would be nice - I find myself counting zeros....