Really enjoy working with bits & bytes in Elixir. The syntax looks weird at first but pattern matching against an incoming message via individual bytes is very nice. I've found the gen_tcp / gen_udp stuff's documentation to be a little hard to grok as most of it only gives deep in the Erlang modules but once you "get it" you really get it. It plays very nicely with GenServer's too for super reliable, fault tolerant, tcp/udp acceptor clients. Thanks for the article, this will be a good resource for everyone to learn more about gen_tcp/udp directly!
whalesalad|2 years ago
giraffe_lady|2 years ago
The nomenclature around binary/bitstream/charlist/iolist is fairly messy though. But to be fair I think most or maybe all of that shit is just straight from erlang. OTP is a rock solid standard lib but we used to joke that they just took turns naming modules and functions. "Everyone gets to do one!" There's no consistency.