tags:

views:

132

answers:

2

Both EWGI and webmachine provide abstractions of HTTP in Erlang. I would like to know what the key conceptual differences are in their approach?

+3  A: 

EWGI is supposed to be a common API for writing request handlers, an API that many web servers implement. EWGI is inspired by Python's WSGI.

Webmachine is just a standalone application with its own API that it is alone in implementing.

Christian
+7  A: 

EWGI provides an abstract place for HTTP middleware, and is essentially blind to anything deeper than the existence of a Request/Response pair. This is a tried and true pattern for stacking layers of systems to build a coherent whole, but it does not help to make that whole system to be correct or understandable.

Webmachine contains an explicit model not just for handling requests, but for managing the internal semantics of the HTTP protocol itself. By providing the application developer with a straightforward and expressive way to describe their application's HTTP behavior, Webmachine makes it very easy to create systems that are shaped like the Web and are very easy to understand.

The two systems are potentially complementary. Right now Webmachine only uses mochiweb-provided requests and responses, but if a solid patch was provided that allowed Webmachine to act as an EWGI application was produced I suspect that it would be accepted. Given the shape of the two systems this should not be too large an undertaking.

Justin Sheehy