"the tragedy of gemini" https://maya.land/monologues/2021/01/11/the-tragedy-of-gemini.html
The same point could be made about Mastodon, or Scuttlebutt, or even the blogosphere back in ye olden days before social media. It's an uncomfortable point to make because it comes off as inherently elitist.
Maybe a less elitist way to put it would be: if you've put in the effort to join a community (learning HTML, learning Gemini, whatever), you have some stakes in the system, and you're less likely to be a bad citizen?
Did GitHub tutorial.
Did 20 levels in githug.
I actually think this would be better as a video than as a thread 🤔
What do you think? Is it an ok example? Did I gloss over any confusing parts?
I want to go back to encoding sometime - it's nice to have simple data but what if we wanted a string of arbitrary length? Or we didn't know our data format in advance? How do we deal with that?
Now we can ensure we're always parsing our packets from the beginning and we wont get out of sync with our weather station
So now we can put a 5th byte at the end of our packet and it can look like this
TEMP1, TEMP2, HUMID, WIND, END
so worse case if we loose a byte it will look like this
TEMP1, TEMP2, ????, END
we'll see the packet isn't 4 bytes long and we can throw it away
SLIP was also meant to run on simple hardware so instead of just escaping END when it came up, it actually replaced it with a special alternative value so when you saw an END it was always the end of a packet.
(same deal for ESC, when you saw an ESC it was always an escape)
END is 11000000
ESC is 11011011
But don't really worry about that
You're probably thinking of the backslash in strings and how "\n" is a newline and "\\" is a literal backslash it's basically the same concept.
So SLIP had another approach. Instead of reserving a single bit off of every byte, lets reserve two specific byte sequences. One we'll call END means THIS PACKET IS OVER and the other we'll call ESC means THE NEXT BYTE IS ESCAPED
This means we can't ever have 8 bit data encoded in a single byte, it will always take two bytes. This isn't a problem for small numbers or even for ascii strings, but unicode? Larger numbers? Actual binary data like a file? It becomes a problem fast.
We could reserve the first bit of each of our bytes and make a 1 mean "HEY PACKET STARTS HERE!" and a 0 mean "I'm the middle of a packet!" (this is exactly what midi does)
I'm going to skip over an approach that would work here that a TON of devices (including the MIDI standard!) use still today. That approach is to reserve a bit or two in one of your types to mark the first byte of a packet.
SLIP is a common packet protocol for encoding arbitrary data in packets over serial. It stands for Serial Line Internet Protocol
But the internet part isn't really important the arbitrary data part is important.
So back to my failed SLIP example.
Because of this binary protocols usually have two parts. A way to serialize the data into binary and decode it out, and a way to packet and synchronize the reading of packets.
Because looking at a few of our packets in order there's no way to know where one packet starts or ends