D alternative for node.js's socket.IO?

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Mon Oct 22 05:36:00 UTC 2018


On 10/21/18 11:59 PM, Neia Neutuladh wrote:
> On Sun, 21 Oct 2018 23:05:06 -0400, Nick Sabalausky (Abscissa) wrote:
>> I'm afraid I'm not familiar with socket.io, and the homepage doesn't
>> seem to tell me much (it doesn't even say whether it uses TCP or UDP).
>> But that said, in D, the gold-standard for pretty much *anything*
>> related to networking and sockets is Vibe.D: http://vibed.org/
> 
> socket.io is a mix of XMLHttpRequest, websockets, and maybe long polling,
> based on HTTP of course. It's all Javascript, designed for a browser as a
> client and Node.js as a server.
> 

Ahh, ok, I see. (Can't believe they couldn't have just said so on their 
currently-vapid homepage!) If that's the case, then Vibe.D's existing 
HTTP and TCP support is perfectly sufficient, and will probably also 
result in FAR simpler user code due to the lack of necessity for 
callbacks. At least on the server side, anyway. If the client side is 
inside a web browser, then just like ANY language that isn't JS, you'd 
still have have to (directly or indirectly) deal with the fact that 
JS/Webasm is really the ONLY Turing-complete code naively supported by 
modern browsers.

But, unless I'm being overly pessimistic (entirely possible), that does 
suggest a possible important area of improvement for libs such as Spasm: 
a simple no-brainer, common websockets-based API common to both client 
and vibe.d-based server.


More information about the Digitalmars-d mailing list