Live data from Hacker News

Let’s Build a Web Server. Part 2

ruslanspivak.com

1–9 of 9 posts

Re: Let’s Build a Web Server. Part 2

#2
I'm trying to get a better idea of the landscape here.

> Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack

No mention of node.js. I get the impression that there is less struggle with node because it has a http server built in. Is that ideal, or would node benefit from a WSGI-like interface? Is anybody working on that?

Or, if a node-style built-in server is better for performance and compatibility, is anybody implementing one for Python, Ruby, or Java?

Re: Let’s Build a Web Server. Part 2

#3
post #2

I'm trying to get a better idea of the landscape here. > Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack No mention of node.js. I get the impression that there is less struggle with node because it has a http server built in. Is that ideal, or would node benefit from a WSGI-like interface? Is anybody working on that? Or, if a node-style built-in server is better for p…

WSGI is a standardised interface / API. Since Node already has a de-facto standard of the built in HTTP package, why would it want another standard? A built-in server certainly provides for better compatibility in that people are more likely to use the existing request & response objects rather than code something totally different, but performance is mostly a property of the server implementation, rather than the interface specification.

Re: Let’s Build a Web Server. Part 2

#4
post #2

I'm trying to get a better idea of the landscape here. > Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack No mention of node.js. I get the impression that there is less struggle with node because it has a http server built in. Is that ideal, or would node benefit from a WSGI-like interface? Is anybody working on that? Or, if a node-style built-in server is better for p…

> Or, if a node-style built-in server is better for performance and compatibility, is anybody implementing one for Python, Ruby, or Java?

Plenty of evented servers in java,ruby,python already (netty,celluloid,event machine, twisted python...)

Re: Let’s Build a Web Server. Part 2

#5
post #2

I'm trying to get a better idea of the landscape here. > Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack No mention of node.js. I get the impression that there is less struggle with node because it has a http server built in. Is that ideal, or would node benefit from a WSGI-like interface? Is anybody working on that? Or, if a node-style built-in server is better for p…

There is JSGI, but not sure if it is used widely.

http://wiki.commonjs.org/wiki/JSGI/Level0/A

Re: Let’s Build a Web Server. Part 2

#8
post #2

I'm trying to get a better idea of the landscape here. > Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack No mention of node.js. I get the impression that there is less struggle with node because it has a http server built in. Is that ideal, or would node benefit from a WSGI-like interface? Is anybody working on that? Or, if a node-style built-in server is better for p…

There is JSGI, but not sure if it is used widely. http://wiki.commonjs.org/wiki/JSGI/Level0/A

I think JSGI was somewhat notable in the early days of Node.js until Connect became popular.

Connect is a middleware framework for node's http module and IIRC became the basis of Express (which is now entirely independent of Connect but remains compatible with Connect middleware). Express is (still) the most popular Node.js web framework.

I think the problem with JSGI is that it's not built into Node.js and the Node.js community tends to favour smaller, specialized libraries. JSGI just seems like an unnecessary layer of indirection from that point of view.