What is Nostr?
Nicolas Martyanoff /
npub17vs…jc6l
2024-01-28 14:55:14

Nicolas Martyanoff on Nostr: Go has neither algebraic data type nor unions. So if you want to represent an IMF ...

Go has neither algebraic data type nor unions. So if you want to represent an IMF address which is either a mailbox or a group, you'll end up with an interface{} meaning you are losing type safety. The language is just not expressive enough to represent the problem space.

At least C had unions, this is clearly something it did better (and also const, enums…).
Author Public Key
npub17vstmkjpd25e72hqjjwu54krhav2nq2unhnm49g268a9drdzhqtqjmjc6l