erlangwebmachine

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?


Solution

  • 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.