5 ms·
NTP Implementation in Elixir
- nubinetwork 3y ago[flagged]
- signa11 3y agowhoopsie ! not much discussion on that, perhaps we might see some action this time around.
- nubinetwork 3y ago[flagged]
- AlchemistCamp 3y agoIt was submitted by a different person each time.
- deleted 3y ago[deleted]
- nubinetwork 3y ago[flagged]
- misnome 3y agoCalling dupe on a post in favour of one with no discussion just wastes everyones time.
- xrd 3y agoThis was a really fun read. It's interesting to think about why the prior submission by the author himself didn't get any comments or traction and this resubmission did. Timing? As of right now, there are really only two non-meta comments here after all. Which is too bad, this is a great write-up and very fun.
- clone1018 3y agoReally 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 3y agoMy "learn elixir" project was writing a full API/client for communication with a NEO-M8 GPS chip via i2c bus. I have never done any i2c hardware programming in my life. Suffice to say I bit off way more than I can chew and it barely works - but it's definitely been incredibly rewarding to use such a high level language to do such low level things with relative ease.
- giraffe_lady 3y agoCompletely agreed, I had to reverse engineer and communicate with an undocumented telnet interface last year at work. It was a brutal pain until I decided to do it in elixir, where it was merely annoying. 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.
- aeruder 3y agoI really like how well the pattern-matching system in Elixir works with decoding binary data. It can even extract on non-byte boundaries.
- J_tt 3y agoWhat’s fantastic is you can reference an unpacked variable immediately within the bitstring. This is super handy if you have variable length sections with a header, such as a DNS packet, saving having to do it in two operations.
- ralphc 3y agoCompared to the bit packing I had to do in C in the 80s Elixir is a joy. The bit operations in a pattern-matched functional language is what got me hooked on Elixir.
- gumby 3y agoI would think that a language like Elixir would have latency issues that would be a problem for NTP. I didn't see any discussion of this in the article -- can Elixir be deterministic?
- aomix 3y agoSince the NTP client is usually just drifting towards the server time with clock skew maybe this would only manifest as doing this process a little slower. If latency was even a problem in the first place.