Sorry, I shouldn't have said something if I didn't have something good to say. Should I delete it, or just leave it?
Appreciated! No need to delete it - it's just a matter of learning for the future, and we're all working on this.
5 days of work is insane for you?
No, the time isn't really what I'm referring to—ip addressing is complicated. But it shouldn't require having to work around the language to do this kind of thing.
I'm not sure how this is a "work around the language" rather then the standard library in Golang is allocation happy for IP types. I imagine this would look very similar in almost any language.
For example, look at rust's [0]. It claims to vary in size depending on os, but on Linux, at least, it's 20 bytes.
This type doesn't appear to support IPv6 Address Zones which was the most complicated part of the post. Actually from my limited googling Rust doesn't seem to support Address Zones at all in it's standard library.
That's a good point.
It also doesn't include the ipv6 zone scope. Adding that would take it to at least 28 bytes, and still have to handle all the interning problems for cheap equality.
The entire section about comparisons and string interning is extremely "work around the language".
Interning is to reduce memory usage. I will agree the uintptr trick is a work around for the lack of weak refs in golang but the code isn't that different then what you would write if you have a referenced counted cache.