Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"It is far easier to take a fundamentally-streaming stack and layer conventional request-response on top as a special case than it is to take a conventional request-response stack and layer a stream on top of that."

This is demonstrably true in that Rack/etc are themselves almost always built on top of conventional socket-based streaming APIs. Streaming APIs have been the norm, and yet people choose to put abstractions on top of them. Why? Mostly because it gives substantial improvements to application code, and turns the system into more of a set of contracts and less of a mushy touch-any-object-you-want system, which I think is fundamental to how streaming works, due to its imperative nature.

Using Rack or any of its equivalents, it would be fairly easy to allow a hole to be punched through the system to give a direct socket streaming API. Just toss the relevant objects into the request. It would violate the abstractions of Rack, any middleware, etc. But you can do it, and it would be easy. It's not unlike using Rack instead of the abstractions Rails puts on top of it – arguably it can be useful shortcut parts of the stack.

Why don't people do this? Mostly because no one cares to. It's not that useful or interesting or testable. It's noticeable enough that people complain about it, but not noticeable enough to be worth it to take the hit and use a more imperative API.



I would submit you also have the causality backward and are also talking about the results of the current factoring, not the cause. It is definitely not true that you have a choice between response/request and an abstractionless formless mass of a socket. I offer you XMPP as one readily-available counterexample. HTTP itself, if properly and fully implemented, is actually another. It worked itself into a streaming protocol, and many frameworks never noticed. This is part of the reason this cheeses me off so much, because even the putatively-HTTP frameworks can't actually speak the fullness of HTTP. Oh, and good luck supporting the full range of SPDY in your request-response framework.

The idea that streaming can't have abstractions put on it is beyond bizarre.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: