You won't regret it.
You won't regret it.
Login to reply
Replies (2)
Do you have thoughts on migrating from go-nostr to nostrlib?
I've started using go-nostr as it was the main (and only) nostr library for go, also because I used khatru before building rely.
I've contributed 3 PRs to it, each time after seeing my projects panic in production.
The first time, because the event CheckID method panic when the event had a shorter ID.
The second time because it tried to access a tag without checking it was there.
And the third, because I've discovered a data race that originated from completely misusing goroutines.
https://github.com/nbd-wtf/go-nostr/pull/183
The first two were silly mistakes, but the third really highlights a pattern I found in the whole library:
The abuse and misuse of goroutines, the overcomplicated and convoluted patterns to provide synchronization.
I've looked at the new nostrlib, admittedly not much, but I've sees the same bad patterns over and over.
So, my current thinking is that, if I'll migrate, I'll probably migrate to a simpler library that only provides the data structures for nostr, which is the only thing rely uses.
Also because the JSON encoding / decoding can be made much more memory efficient, which would benefit relays a lot.
So yeah, long rant 😝