[erlang-questions] ANNOUNCE: adapter_pattern for mochiweb/cowboy/misult and scripting language
Edmond Begumisa
ebegumisa@REDACTED
Fri Feb 17 15:57:15 CET 2012
On Sat, 18 Feb 2012 01:31:57 +1100, Joe Armstrong <erlang@REDACTED> wrote:
> This is an experiment - but the code is rather pretty so it might be
> of interest.
>
> https://github.com/joearms/adapter_pattern
>
> What's this all about? Mochweb, misultin and cowboy all have
> *different* interfaces
> I don't like this. I have made a simple generic interface to all three.
>
> Yesterdays announcement that misultin would not be supported in the
> future
> sparked off this work - I'd been thinking about how to abuse
> paramerised modules for a while
> so this seemed like a golden opportunity.
>
> I also threw in a web scripting language called EHE. EHE is "Html with
> embedded Erlang"
>
> So <?e Name = "joe" ?> has <?e integer_to_list(Name) ?> characters
>
> would print out "joe has 3 characters" - inside the <?e ... ?> we
> expect a sequence of
> Erlang expressions. The replacement value is the value of the *last*
> expression in the
> sequence which must be a string. Bindings are forward propagated in the
> script.
>
> That's it.
>
> Although this is *very* simple it is also very powerful (ie it has the
> full power of all of erlang)
>
> It is also very easy to embed into your favorite web server - the
> example on github shows how
> to embed ehe into mochiweb/misultin and cowboy.
>
> It would seem to me to be advantageous to agree to use EHE (or
> something better) on all
> available erlang web-servers - since a common langage would encourage
> code sharing and so on
> (like PHP)
>
EHE reminds me of Yariv's ErlTL which I very much like...
https://github.com/yariv/erlyweb/blob/master/src/erltl/erltl.erl
http://yarivsblog.blogspot.com.au/2006/10/introducing-erltl-simple-erlang.html
http://yarivsblog.blogspot.com.au/2006/10/erltl-091.html
ErlTL has some nice features, perhaps these two could be combined.
- Edmond -
> Take a look?
>
> Is this the right way to go?
>
> Cheers
>
> /Joe
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the erlang-questions
mailing list