Live data from Hacker News

uWebSockets: Scalable WebSocket server library for Node.js and C++11

github.com

61–70 of 87 posts

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#61
You say you support Windows, but when I try to use it, it gives me an error

     Error: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++ compiler and reinstall the module 'uws'.
A) Which are the supported compilers?

B) This issue makes it seem like that wouldn't matter, anyway? https://github.com/alexhultman/uWebSockets/issues/72

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#62
It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary:

  warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align]
  warning: declaration shadows a field of '...' [-Wshadow]
  warning: declaration shadows a local variable [-Wshadow]
  warning: implicit conversion changes signedness: '...' to '...' [-Wsign-conversion]
  warning: implicit conversion loses integer precision: '...' to '...' [-Wconversion]
  warning: implicit conversion loses integer precision: '...' to '...' [-Wshorten-64-to-32]
  warning: macro name is a reserved identifier [-Wreserved-id-macro]
  warning: no previous prototype for function '...' [-Wmissing-prototypes]
  warning: operand of ? changes signedness: 'int' to 'char' [-Wsign-conversion]
  warning: unused parameter '...' [-Wunused-parameter]
  warning: use of old-style cast [-Wold-style-cast]
Use with caution!

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#63
post #62

It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary: warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align] warning: declaration shadows a field of '...' [-Wshadow] warning: declaration shadows a local variable [-Wshadow] warning: implicit conversion changes signed…

Why do I care if it's using an "old-style cast" (I presume something like `(float)var` instead of `float(var)`, replacing a reserved identifier with a macro, or contains implicit casts (like `1.0 + 1` instead of `1.0 + float(1)`)?

Don't C++ compilers give lots of unimportant warnings?

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#64

Hey there. Just wrote down a few things that came to my mind after seeing this. Don't see it as criticism, but as a few hints/remarks what has to be covered by a websocket (or any other protocol) implementation. Imho the high performance part isn't too hard to achieve and shouldn't be the highest rated. The important thing is that such a server should be rock solid in implementation, otherwise it's worthless. Some th…

For your first set of questions: it's single threaded. If you want use multiple processors/threads, you start multiple servers, and either distribute loads with a load balancer or give each one a different TCP port.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#65
post #47

Earlier quoted context omitted.

Humility and a collaborative attitude are really important to get the best results. When people attack your code, it isn't an attack on you. It makes your code better. It's one of the downsides to releasing any opinionated project (and many good projects are opinionated). For my part, I won't use software written by someone who doesn't either refute criticism or use it to improve code, and I'm not satisfied you're do…

According to logic, this quote "yeah - the C++ bits were clearly written by someone who doesn't know the language well. I'd be careful about using this code in production." is a personal attack. I get offended by this, personally. When I get offended, personally, I answer how ever I see fit. Thank you, you will be missed. I don't know what to do without you.

I agree, the original post was an attack. But then you attacked back. Now you're both mudslinging uglyshit.

Also, your work looks good. I want to use it.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#66
post #17

I'm already using it on a socket.io production server. Super-stable for days, and noticeably less cpu / memory usage. Great open source software !

Yep, thanks for being one of the first adopters :) Like mentioned, it works as an optional engine in Socket.IO, Primus & SocketCluser (in which it will be default in version 5). No code change, swap when you feel lucky :P

I want to use it with SockJS. Do you have any plans or interest in that?

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#67
post #62

It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary: warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align] warning: declaration shadows a field of '...' [-Wshadow] warning: declaration shadows a local variable [-Wshadow] warning: implicit conversion changes signed…

So you enabled pedantic warning level, and you got a bunch of pedantic nonsense warnings.

There is a reason for these not to be enabled by default.

* Unused parameter -> rly? Who gives a damn? * Use of old style cast -> Well I'm old style, get over it. * No previous prototype declaration -> Again, I do this if I want to. * Shadows field -> who cares? No me. * Cast increases required alignment -> Well, obviously the perf cost is not an issue here. * Etc, etc, etc

These are pedantic warnings. However, this is an open source prject and you are free to send me PR's whenever you want.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#68
post #63
post #62

It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary: warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align] warning: declaration shadows a field of '...' [-Wshadow] warning: declaration shadows a local variable [-Wshadow] warning: implicit conversion changes signed…

Why do I care if it's using an "old-style cast" (I presume something like `(float)var` instead of `float(var)`, replacing a reserved identifier with a macro, or contains implicit casts (like `1.0 + 1` instead of `1.0 + float(1)`)? Don't C++ compilers give lots of unimportant warnings?

Yes, my friend. This guy is trying to roast the library based on bullshit warnings that normal projects (Node.js as one example) explicitly disable. So if you want to make a case out of this, you will have to report this "issue" to Node.js developers also, because they also have a lot of warnings ignored by turning them of, simply because they are pedantic.

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#69
post #63
post #62

It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary: warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align] warning: declaration shadows a field of '...' [-Wshadow] warning: declaration shadows a local variable [-Wshadow] warning: implicit conversion changes signed…

Why do I care if it's using an "old-style cast" (I presume something like `(float)var` instead of `float(var)`, replacing a reserved identifier with a macro, or contains implicit casts (like `1.0 + 1` instead of `1.0 + float(1)`)? Don't C++ compilers give lots of unimportant warnings?

[deleted]

Re: uWebSockets: Scalable WebSocket server library for Node.js and C++11

#70
I want to thank all people involved in making this open source project possible. Things are by far not set in stone and this library has only been in development for about 2 months now.

We are working with SocketCluster to make µWS default in version 5, and I have gotten a lot of help from a lot of people during these months.

Thanks for support, I will be accepting PR's and receiving issues that we need to fix before making any kind of official stable release.

Also, try to ignore the hateful comments - these commenters build their cases on thin air, and if you actually do find anything you want to change - I will accept PR's that can be shown to improve the library.

Post reply on HN