Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Web Development with OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jimmie Houchin <jhouchin@t...>
Subject: Re: [Caml-list] Web Development with OCaml
I would be interested in seeing any code you have available for release.
Any code is at least usable for learning.

A multi-tiered architecture is advocated by some but not all.
Philip Greenspun wrote a book called 
Philip and Alex's Guide to Web Publishing
http://www.amazon.com/exec/obidos/ASIN/1558605347/
view it online at:
http://www.arsdigita.com/books/panda/

He advocates using a two or one tier system. In the book he talks about
AolServer with it's built-in Tcl interpreter and his ACS, Arsdigita Community
Service web app.
http://www.arsdigita.com/products/
http://www.arsdigita.com/

He argues against the three-tiered model. Quite effectively I might add. You
might not agree with everything he says, but he does make a provocative
argument. In his book he talks bad about Java. He is actually a Lisp (Scheme)
proponent. Unfortunately his company took some VC money and now sings the Java
song. Blech. I don't think he liked it tho'.

If there were a sufficient group of people wanting to work towards such, his
ACS provides an excellent model from which to base ideas.

I think that
A web server written in OCaml which is extensible by OCaml modules,
With a built-in templating system based on HereDoc, Pxp, or Camlp4 and
A built-in persistent database connection pool
Could be the basis of an excellent two-tiered system.

>From this you could build a web app such as ACS.

There are several good models from which to get ideas which are implemented in
reasonably friendly languages. There are many templating tools from which to
borrow ideas. The nice thing is to find the tool we like and port it or
rewrite it for and in OCaml.

Am I wrong? Zope, Python can provide 20-80 rps.
Python is not known for it's speed.
Couldn't an implementation in OCaml perform better without sacrificing much in
a user friendly deployment language?

Erlang, an interpreted functional language, has it's own web server and
capacity to extend in Erlang.
It also has an excellent distributed database.
It performs equal to or better than Python's setup. (From my understanding)
Could not OCaml do equal or better?

Can't OCaml do better than the Java ...? :)


I would think OCaml could do well better than all of the above.
Am I wrong?
Am I wrong that there would be benefit to such?

This could be done well with an OCaml web server or with a mod_ocaml.

Behind either you develop the web app server.

Advantages mod_ocaml.
  Let the Apache group do what they do best.
  Ride their coattails and use their tools.
  Use OCaml for building the web app and site.
  Increased mind share for OCaml.

Advantages OCaml web server.
  One language, one tool.
  OCaml and go...

They are not mutually exclusive. :)

If the benefits I see are real and exist. 
Then the main issue is creating the community which develops these tools.
I believe this can come from those in this community who have done parts of
the tools.
I also believe that this is a project which when successfully organized and
active can attract other developers.

Well enough for now. I need to get back to the docs and see if I can wrap my
brain around OCaml. :)
If I can and choose to use OCaml for my web site I'll be happy to contribute
any non-site specific code to the project.

Jimmie Houchin



Francois Rouaix wrote:
> 
> To add a few cents to the discussion
> 
> > 5. An OCaml Web Server. I don't know what's available here yet.
> >        I haven't had the time to research yet.
> >        This could be a very interesting option, especially if it's fast.
> >        This could easily be an excellent option to put behind Tux.
> >        Tux serves number 1. above and passes all dynamic services to this
> > server.
> 
> Back in 1996, I had something called V6 running in OCaml; it was an HTTP
> proxy with
> a bunch of interesting features, and could serve as a Web server. However,
> this was
> a long time ago, and iI implemented only HTTP 1.0, not 1.1. Also, we didn't
> have threads in
> native mode in those days. The speed was still reasonable. I remember that I
> could
> easily use 60% of  our 10 Mb/s network (network still being used by other
> stuff in
> the lab).
> 
> > Is there any interest in a mod_ocaml or a fast-cgi module for OCaml?
> > I haven't a clue on how to develop either but could possibly learn. :)
> > After learning OCaml (at least some) first.
> 
> Actually, I did start an mod_ocaml project a couple of years ago. I had the
> core
> working, meaning that I produce a very simple page with the module.
> However, I stopped before moving forward because of the intricacy of
> correctly
> designing the whole thing (configuration, separation of name spaces between
> user-modules, compilation and loading on demand, etc...).
> Also, I had doubts about the usefulness of a mod_ocaml. In practice (meaning
> in the real .com world, where I was working at the time), one uses multiple
> tier architectures. And you want something in the frontend that is simple
> enough
> that non-real programmers can still tweak; something that only does layout,
> and
> no logic.
>
> If someone is interested, I might be able to retrieve the source. There is
> a good OReilly book on Apache modules (although Apache 2.0 may make
> this obsolete altogether).
> 
> --f
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr