4 ms·
I was going to complain about lack of benchmarking, but then I saw the "Why" section - I wonder what else could be shared using a single tweet.
by spiznnx 11y ago
I was going to complain about lack of benchmarking, but then I saw the "Why" section - I wonder what else could be shared using a single tweet.
- TazeTSchnitzel 11y agobase65536 can fit at most 280 bytes in a tweet. Most tweets I make are pure ASCII, which is 7 bit. (280 * 8) / 7 = 320 septets Well, 160 septets is the non-Unicode maximum length of an SMS. So a tweet can fit two SMS messages in it!
- mikeash 11y agoYou could do slightly better by not restricting yourself to the BMP. Full Unicode gives you almost 21 bits per code point, which is what Twitter counts. Round it down to 20 bits per "character" and you have 2800 bits = 350 bytes in a tweet, or 400 ASCII characters.
- desdiv 11y agoUnfortunately that won't work. Twitter doesn't support the full Unicode; they strip out any Unicode code points that's not used by "normal" people.
- TazeTSchnitzel 11y ago> they strip out any Unicode code points that's not used by "normal" people. Such as?
- goodplay 11y agoLTR and RTL marks (all of them), which are used when the default Unicode bidi algorithm fails to display two intertwined scripts correctly. They are especially useful when writing short technical tweets. I bet normal people would use them too if they knew about them and were given a chance, but normal people can't because twitter doesn't allow codepoints that aren't used by normal people.
- TazeTSchnitzel 11y agoStripping out LTR and RTL override might be reasonable because they're frequently abused to screw up website layouts. But stripping all of the marks is just discrimination against people who need to write bi-directional text.
- cbd1984 11y ago> Stripping out LTR and RTL override might be reasonable because they're frequently abused to screw up website layouts. As long as Twitter allows Zalgo it isn't that concerned about website layouts. (Zalgo: Rampant abuse of stacking combining diacritical marks above and below the line. It can get really, really... uh... impressive, in a Lovecraftian typewriter art kind of way.)
- goodplay 11y agoThe issue of effecting web layout can be resolved by simply appending the appropriate resetting codepoint to the tweets. (U+202C for bidi overrides)
- amptorn 11y agoWell, null, to start with. Other ASCII control characters. Consecutive line breaks, too.
- mikeash 11y agoInteresting, is there a list of what they strip out? I know they apply normalization so that would eliminate a few, but I think that wouldn't do too much on its own.
- simplicio 11y agoAre you sure? I just posted a tweet in Cuneiform, which is outside the BMP. So their view of "normal people" seems to encompass ancient Sumerians, at least.
- amptorn 11y agoThis is dangerous through, because sending a Unicode string through Twitter subjects it to NFC normalization which can alter its structure. If you want guarantees that this won't happen, your choices of code point are far more constrained, and the unassigned code points, which is most of them, can't even be used. I think this is the purpose of base65536gen. https://www.npmjs.com/package/base65536gen https://www.npmjs.com/package/base65536gen
- userbinator 11y ago256-byte demos come to mind: http://www.pouet.net/prodlist.php?type%5B%5D=256b http://www.pouet.net/prodlist.php?type%5B%5D=256b A little effect in 256 bytes of binary code. Some of them are amazing: http://www.pouet.net/prod.php?which=66380 http://www.pouet.net/prod.php?which=66380