The problem with nostr is that nostr:nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gprfmhxue69uhkcmmrdd3x77pwve5kzar2v9nzucm0d5hszxnhwden5te0wpuhyctdd9jzuenfv96x5ctx9e3k7mf0rr5cq2 hasn’t learned Zig yet

It’s all fixable

Reply to this note

Please Login to reply.

Discussion

Zig is the drivechain of programming languages

fiatjaf might actually like it then

Syntactically it really resembles golang, too

Strives to be simple language like golang

god knows zig is as verbose as golang haha

😅

Error handling seems better, but dealing with allocators way more verbose

error handlings is wayyy better in zig.

errdefer is a god send

I started writing that actually, but there was no WebSocket client, so I had to write one from scratch. It kinda worked, but was probably too awful so I felt ashamed.

After that I didn't know how connect to multiple relays at the same time without using multiple threads, so I gave up until someone made that easier for me. What is the correct way to do that type of concurrency on Zig?

I'm still a zig noob and this seems like the answer. Async/await was deprecated from language. I was trying to implement nostr client / relay but got stuck on concurrency as well! I'll figure it out eventually.

One would think a simple semaphore would be enough for must stuff that we are trying

Cool! You guys are thinking about Nostr in Zig. Please don't forget about Wasm support when you do that.