Live data from Hacker News

WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

travisglines.com

61–69 of 69 posts

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#61

One of these is not like the others: node.js is a nice, progressive step forward, not a leap that is discontinuous with what preceded it like WebGL and WebSockets. And certainly, node.js did not enable this chat example to happen -- not in the same way that WebGL or WebSockets did. I am getting a little tired with the node.js cheerleading on HN. I've tried it and I don't see it as a huge leap forward from what can be…

> but any sufficiently complex JS app tends towards callback spaghetti Callback spaghetti is quite easy to avoid. > and maybe I have been doing something wrong If you have callback spaghetti, regardless of the complexity of the app, you are most likely doing something wrong. > I don't see it as a huge leap forward from what can be done with Twisted + Python, or Go Of course not, but it's not hard to imagine that Node…

This is subjective and anecdotal, but every large JS framework whose source I've examined shows this tendency towards spaghetti.

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#62

Earlier quoted context omitted.

Please show me how a server can send two consecutive messages to a long-polling client without requiring the client to make a request between the receipt of message 1 and message 2.

I'm not sure what you are replying to as it's been redacted, but just wanted to say that there's really nothing wrong with that technique. Developers tend to way overestimate the cost of a long polling request with minimal headers. Also the speed benefit of websockets over long polling is so trivial that it doesn't really matter.

A couple of posts were deleted on this thread, perhaps because the authors realized they were mistaken. The claim was that long-polling and WebSockets are bi-directional in the same sense, and mine was that one type of bi-directionality is simulated and has real limitations.

It doesn't matter if the overhead is low: with long-polling, the server can't send a waiting message until the client requests them. With true sockets, the server can send messages as soon as they are available.

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#63
post #34

Earlier quoted context omitted.

I'd argue that being in javascript is an advantage rather than a disadvantage. Sharing code between server and client (browser) is much easier, and there is no alternative to javascript in the browser. I'm not saying javascript is the king of languages, just that we're limited to it because that's what's in the browser, and writing server code in the same language simplifies things.

> Sharing code between server and client (browser) is much easier, and there is no alternative to javascript in the browser. That's a fallacy, the environments have nothing in common, the coding styles and interactions don't either, the only things you're going to be able to meaningfully share are trivial helper libraries à la underscore.. > and writing server code in the same language simplifies things. Why? How? Wh…

A fallacy? Sharing code between client and server is easier when the two are in the same language than when the two are in a different language. How is that flawed reasoning?

One example: you can run the same input validation in the client as you do in the server if you can easily share code between the two.

But there is way more. Here's an example of an application that shares all of its data models between client and server: http://tilemill.com/docs/models.html

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#64
post #45

WebSockets are really cool but we found the browser implementations unstable enough that we switched back to XHR for Tinkercad. Especially since the secure implementations were super shaky and we run all our traffic over SSL. We also use Go and not Node.js for the backend so the only thing qualifying us for this perfect storm is WebGL.. :-)

[deleted]

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#65
post #45

WebSockets are really cool but we found the browser implementations unstable enough that we switched back to XHR for Tinkercad. Especially since the secure implementations were super shaky and we run all our traffic over SSL. We also use Go and not Node.js for the backend so the only thing qualifying us for this perfect storm is WebGL.. :-)

Totally agree with this. We were using WebSockets initially and it worked great in Chrome and not too well everywhere else. We got the exact same user experience/effect by switching over to XHR with a fairly frequent polling interval. It's much more reliable and we found it easier to program, test, and debug.

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#66
post #45

WebSockets are really cool but we found the browser implementations unstable enough that we switched back to XHR for Tinkercad. Especially since the secure implementations were super shaky and we run all our traffic over SSL. We also use Go and not Node.js for the backend so the only thing qualifying us for this perfect storm is WebGL.. :-)

I'd love to see a blog about your experience with using Go as your web server. Did you use the standard library, Web.go, or something else? There have only been a few deploy production web apps with Go so far, so the knowledge needs to spread.

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#67
post #60

Earlier quoted context omitted.

I definitely regard server side JavaScript as a strong advantage - doing client development in JavaScript, database development in CouchDB is feels wrong to be doing the server application component in something else.

Why does it feel wrong? JavaScript isn't that great a language; even if you use CoffeeScript, there are nicer languages out there, and on the server you have the option of using whatever language you want. Using the same language on client and server can come in handy if you've got some non-trivial amount of code they can share in common. When I made a multi-user text editor (think Etherpad, but simpler), all the cod…

Of course, the comment about it being "wrong" is completely subjective. I just really like JavaScript these days (and I've been paid to program in a lot of other languages - Lisp, C, C++, PostScript, Java, C#...).

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#68

Earlier quoted context omitted.

Close your browser. Open the console. Open your browser with: google-chrome --enable-webgl --ignore-gpu-blacklist

This does not work on Chromium 12.0.712.0 (79102) on Ubuntu 10.10. Everything just silently fails with "Error creating WebGL context." in JS console.

I'm not really sure what is wrong, but it might be that you lack OpenGL libraries. You might want to check out this page: http://learningwebgl.com/blog/?p=11

I figure I might as well let you know what you're missing. The guy coded up a 3D world in which you walked around as a square with text floating above your head. It reminded me of World of Warcraft and other MMOs, despite its graphics being far below those of Minecraft.

Re: WebGL + Node.js + WebSockets = A Web Technology Perfect Storm

#69
post #45

WebSockets are really cool but we found the browser implementations unstable enough that we switched back to XHR for Tinkercad. Especially since the secure implementations were super shaky and we run all our traffic over SSL. We also use Go and not Node.js for the backend so the only thing qualifying us for this perfect storm is WebGL.. :-)

I'd love to see a blog about your experience with using Go as your web server. Did you use the standard library, Web.go, or something else? There have only been a few deploy production web apps with Go so far, so the knowledge needs to spread.

For Tinkercad the http server is just a relatively simple transport layer, the magic happens with how the computation is distributed in the cluster. We'll blog about it once things settle down a bit, at this point we are just trying to soldier ahead with the beta. :-)
Post reply on HN