Thread

Zero-JS Hypermedia Browser

Relays: 5
Replies: 3
Generated: 21:29:37
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 😝
2025-11-04 21:31:58 from 1 relay(s) ↑ Parent 2 replies ↓
Login to reply

Replies (3)

No, that makes sense. fiatjaf's libraries tend to have some super important primitives in them (like the event and filter structs) alongside very opinionated stateful stuff like khatru and nostr-tools' relay connection logic. It would be nice to have a nostr basics library with a much smaller scope that everyone could agree on so you don't have to write adapters between other libraries.
2025-11-04 21:36:08 from 1 relay(s) ↑ Parent 1 replies ↓ Reply
Yeah It would be nice. Not to mention the dependencies, which is something I try to be aware. go-nostr and nostrlib have 30+ dependencies, 2 different libs for websocket, and 3 for json! Like wtf
2025-11-04 21:54:08 from 1 relay(s) ↑ Parent Reply
Thanks for the explanation, I was thinking "why not khatru" during all the video. It's very useful to know why you decided to build a new project from the grounds up. I recall nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku also had sync issues with khatru, and he also builds a relay, called 'realy'. Now really, we have rely, realy as relays. I guess it's not easy to google them if something goes wrong... :D
2025-11-07 20:31:05 from 1 relay(s) ↑ Parent Reply