[erlang-questions] Erlang Web Libraries & Frameworks

Sam Elliott sam@REDACTED
Thu Aug 11 12:11:31 CEST 2011


On Thu, Aug 11, 2011 at 10:30 AM, Loïc Hoguin <essen@REDACTED> wrote:
> On 08/11/2011 11:01 AM, Joe Armstrong wrote:
>> If all suppliers of web- frameworks could adopt a common adapter
>> pattern - it would make
>> life a lot easier. I realize that this would not allow us to use some
>> of the finer facilities
>> offered by an individual web-server, but it would be very useful for the simple
>> cases of serving up files etc.
>
> A lot of people choose the server based on those finer facilities.
> Adaptor projects are already used by everyone else. See below.

I don't think that's much of an issue. People don't have to use the
adapter, but where it is helpful, they have the possibility of using
it.

In a lot of cases, People don't care which library they are using,
they just want to use one that they understand and can get started
with quickly.

>
>> One could have a common API then choose the implementation depending upon
>> the requirements of the application.
>
> This is fine and all, but some servers use lists while others use
> binaries. The handler code is obviously different so some servers would
> require converting everything (headers, path, ...) to lists or binary
> before passing the data to your common handler. There's no clean
> solution there.

I think the solution is to choose some sensible defaults for the
adapter API, then put effort into the conversion that the underlying
implementation requires.

> Some projects exist, like simple_bridge for example, but AFAIK they only
> do lists-based servers for now.

SimpleBridge (https://github.com/etnt/SimpleBridge) and EWGI
(https://github.com/skarab/ewgi) seem to be quite close to being
useful as an adapter, but there's still an annoying reliance on
calling things like `simple_bridge:make_request(inets_response_bridge,
Info)` - the abstraction only seems to wrap the request and response
objects to provide a compatible interface. I, however, agree with Joe
in that the abstraction needs to cover far more than that.

I'll probably add SimpleBridge and EWGI to my list today.

Sam

>
> What's a good solution to this?
>
> --
> Loďc Hoguin
> Dev:Extend
>



More information about the erlang-questions mailing list