So, I attempted to use NNG (github.com/nanomsg/nng) and I have to say it's in serious need of being boring. It's full of mostly useless crap like HTTP servers, ZT networks, and the organization is insane. He's hiding struct inside .c files so you can't get at them? WAT?
Nim did alright and claimed to compile a .nim file created with c2nim, so bonus points to Nim. It seemed to work, until you start to use *any* protocol. Then an explosion of missing header files you have to scour the codebase for comes to light.
You want to make a pipeline socket you need a push and and a pull end. What's the code to set that up?
What are you doing dude? I should just #include <nng.h> and go. Compilers already know how to remove code so don't make me include 90 other files. So bizarre.
If I were in charge of this library I'd do the following:
1. Chop out anything that's not pure "message on a socket protocol". No websockets. No http sockets. No AIO "helpers".
2. Make a single .h that you include, with all structs visible, so it's easier to hook and use.
Meanwhile, here's a nonmsg (the NNG predecessor) Nim:
I have no idea what NNG guy is doing but he didn't improve the usability at all.
My take on NNG is that it's more of a Resume than a project you're expected to use. It's purposefully made difficult to use so you have to contact the author for help, buy his book, and hire him, but ironically that makes me not want to trust him working on anything.
A better business model is if he had a simple dead easy implementation of just basic NNG that was easy to use as nanomsg and had no frills.
THEN offer an additional library and sets of software and training that augment it.
That way people try it, like it, and buy more.
The most infamous project to do this "make it impossible so they hire me" open source business model was OpenSSL, and we all know how well that went:
I have a lot of people who recently learned to code but then ask me what they could make. I'm a big proponent of copying everything you like (and dislike too) just to learn how it's done, but I think that's too big of a field for some folks to tackle. Here's some ideas:
You should get a little notebook and start writing down random ideas that pop in your head, even if they're stupid. Try to write more than one sentence about the idea so you know what it is later. Drawing a screen or two helps also.
You could also use Zettlr or RoamResearch.
Next, you need to write a short essay about one of your ideas, explaining the idea and possibly getting into a story about who is using it and how they use it. This will help you "export" the idea into a written form and organize your thoughts.
I'm toying with the idea of getting the PS 5 or Xbox, and I absolutely hate the false scarcity they pull. I mean, I'd pull a J. Wellington Wimpy with "I will gladly pay you Tuesday for a game console next month," but these people just don't know how to write a ordering website.
I'm too old to run around hunting down deals and trying to do Black Friday BS. I don't even care if it arrives next month. Just let me put in an order, send it when it's ready, but *don't charge me until it's sent*. At this point the one I pick is whatever one is available.
I also find it bizarre they can't calculate demand. You've sold like 5 versions of this thing and have the most advanced computerized logistics systems in the world and you're like, "It'll be ready on Black Friday...MAAAAYYBBEEE. Better beat up a grandma for it! MWHAHAHAHA."
Finished this morning's Nim hacking and, well, it has async IO but it's rough as hell. Pretty much nothing is done for you, so it's a lot like JavaScript before async/await, but weirdly it has the await keyword. Some issues with this:
1. I'm not sure why the {.async.} pragma doesn't also setup that function to return Future[T]. It's kind of pointless if all that I get is the await keyword, and then every function I want to wait on has to be hand coded futures. Maybe the docs are just wrong?
2. I'm guessing this is more nanomsg's fault than Nim asyncdispatch, but the whole pollfd, addWrite/addRead system doesn't work on the send. I'll register addWrite, the pollfd will say it's ready, then the nanomsg send actually blocks, which...should be impossible.
Hit a bug in @WindboundGame that is either the worst possible thing they could have, or a possible new way to make the game more challenging. If you enable the blessing Arms of Imakl suddenly I losing things at random, even in held items, and usually after restoring from a save.
The irony of it is this one blessing in the game is *supposed* to help you keep a couple extra items if you die, and give you a couple slots. I tested that it's randomly losing items by actually crashing my boat 20 times and lost nothing. Also dived in the water and nothing.
But, save, and reload, and yep, lost a couple things. I think what's going on is the blessing adds two inventory slots, and the devs added it late, so they get the count wrong on reload and drop two items.
From what I can tell nanomsg has flags for things like "DONT_WAIT", but they seem to be pointless. It doesn't block anyway when you set the flag to 0. I couldn't figure out why it just ran in an insane loop and well, that's all it can do.
One of the things that ZeroMQ did which made it *very fast* is it did a kind of run length encoding of messages. Rather than send 1 million messages all the same, it would just say "that one, 1 million times". Browsing through nanomsg I think that's gone, but it was THE feature
Browsing through the QUIC and HTTP/2 standards and I'm kind of wondering why all those jackasses who told me I was wrong for saying HTTP/1.1 was garbage for being a text protocol didn't freak out at this heresy. You wouldn't believe the illogical backflips the IETF and W3C did.
For a bit of context, I wrote a web server that utilized a precise parser for the HTTP/1.1 protocol, and rejected any messages that didn't parse correctly. Turned out this ended up blocking about 80% of hacks at the time while allowing normal traffic through without problems.
When I did this a whole ton of HTTP/1.1 IETF douchebags made bizarre claims that this would destroy the web, that I had to accept everything or else, and that the parse must be hand written.