Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between the Erlang Web Gateway Interface (EWGI) and Webmachine?

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

like image 413
Ben Ahlan Avatar asked Nov 17 '09 17:11

Ben Ahlan


2 Answers

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.

like image 67
Justin Sheehy Avatar answered Oct 23 '22 06:10

Justin Sheehy


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.

like image 3
Christian Avatar answered Oct 23 '22 07:10

Christian