[erlang-questions] Binary string literal syntax

zxq9@REDACTED zxq9@REDACTED
Thu Jun 7 00:21:14 CEST 2018


On 2018年6月6日水曜日 11時41分01秒 JST Sean Hinde wrote:

> As a protocol wrangling language I would argue Erlang has no peers, but many more protocols are string based now than when the bit syntax was invented.

By count this is patently false. Most protocols are binary based, as the number of ad hoc binary protocols created for IoT vasty outnumber the handful of prolific string-based ones. Can you think of a better language for IoT protocol wrangling than Erlang?

Sure, most people have no clue how to program sockets these days so they use HTTP for everything -- but that isn't *most* protocols, that's a relatively small set of overwhelmingly *prolific* protocols. My prediction is that binary protocols will become more prolific as the extremely limited shared resource of wireless bandwidth becomes more and more saturated (and I don't think compression is a fix-all here, though it certainly helps).

It is very hard to tell whether Erlangers as a whole encounter binary or string-based protocols more *often* because a survey on that sort of thing is very hard to pull off -- but it is pretty clear that the sexy, high-profile cases tend to involve the web and that is indeed mostly string-based stuff.

There is also the issue with file-format deconstruction (which I do a fair amount of) and a LOT of it is binary.

Better handling of UTF-8 (or unicode, more generally, as remember Windows is natively UTF-16...) would be nice as a single case to latch on to and really focus on supporting from every angle -- but it is VERY FAR from being The One Grand Unifying Case.

I've commented on quite a few threads about encodings, strings, why graphemes and lexemes matter, and the myopia that comes with dealing with mostly European originated languages. I live in Japan and deal with Shift-JIS, JIS, JIS7, ISO-2022, EUC, etc. variants all the time. Is that a common case? Not in the West, but it is totally normal here -- especially dealing with web data.

* Binary protocols are alive and well
* The old encodings are far from dead.
* You have a good point about improvements being possible and desirable.
* The best way to proceed is not clear.
* The unicode-correctish improvements to the string and unicode modules are very encouraging.

-Craig



More information about the erlang-questions mailing list