caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: caml-list@inria.fr
Subject: RE: [Caml-list] Web Development with OCaml
Date: Wed, 11 Jul 2001 22:44:53 +0200	[thread overview]
Message-ID: <01071123230712.00523@ice> (raw)
In-Reply-To: <NFBBJPJKELEJMBOIHIDHEEOGCAAA.frouaix@home.net>

On Wed, 11 Jul 2001, Francois Rouaix wrote:
>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.

A good comment. I am currently doing web development, and from my experience the
separation of layout and logic is very useful for real-world projects. Not only
because non-programmers can contribute, but also because of general
maintainability (customers often want only layout changes).

200 requests per second for a web application? Well, I must admit that my web
apps are much slower, maybe you can get 5 rps on a single CPU. But my
applications are very complex, and a clean design was more important than
speed. So I think a high-speed web platform isn't what I need.

My apps are always mixtures of languages and principles. Most of them use Perl
scripts to describe the front-logic, O'Caml as powerful background engine, and
XML to describe the layout. Many applications are simply CGIs. If speed did not
suffice, I switched to a simple application server architecture: A CGI program
is the connection between the web server and the application server, and the
latter simply forks for every new request. This works fine, is rock-stable, and
is fast enough (~0.5 seconds request/response time).

I already mentioned earlier this year on this list that I have written an
XML-based template system that makes it easy to separate layout and logic.
Sorry, I have not found the time to release it. I hope I can do it in the next
weeks (my boss is in holidays).

I have further plans with PXP, my XML parser. The idea is to have a camlp4
syntax extension for embedded XML. You can simply write something like

let table_row (a,b) =
  <:xml< <tr><td>This is $a</td><td>And this is $b</td></tr> >>

let table rows =
  <:xml< <table><?list rows?></table> >>

let my_tab =
  table (List.map table_row ["the first row","another cell"; 
                             "the second row", "nonsense"])

(I am not sure about the syntax.)

A converter from XML to HTML is very simple to write, such that a web app could
dynamically create the XML tree in memory, optionally validate it, and write it
as HTML code. I think that would already simplify web development a lot.

For a complex web application, one needs more library modules. For example a
module that manages the "micro-state" of the application (i.e. the state that
is not stored by the database but simply passed through all requests).
Furthermore modules that help to create and manage HTML widgets.

Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 45             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------
-------------------
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


  reply	other threads:[~2001-07-11 21:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-10  0:01 Jimmie Houchin
2001-07-10  7:10 ` Jean-Christophe Filliatre
2001-07-10  7:15 ` Tom Hirschowitz
2001-07-10  8:19   ` David Mentre
2001-07-10  9:38   ` Alain Frisch
2001-07-11  5:49     ` Jimmie Houchin
2001-07-11  6:03       ` Alexander V. Voinov
2001-07-11 14:47         ` Jimmie Houchin
2001-07-12  1:58           ` John Max Skaller
2001-07-11  6:19       ` Alain Frisch
2001-07-11  9:09         ` Samuel Heriard Dubreuil
2001-07-11 14:11           ` Jimmie Houchin
2001-07-11 15:35       ` Francois Rouaix
2001-07-11 20:44         ` Gerd Stolpmann [this message]
2001-07-12  2:32         ` Jimmie Houchin
2001-07-13  5:37       ` William Chesters
2001-07-13 10:29         ` Alain Frisch
2001-07-13 11:16           ` Vitaly Lugovsky
2001-07-13 14:04             ` Xavier Leroy
2001-07-13 17:08               ` [web-caml] " Vitaly Lugovsky
2001-07-15 18:03               ` Ari Heitner
2001-07-15 20:19                 ` Gerd Stolpmann
2001-07-16  8:23                 ` wakita
2001-07-17 16:18                 ` John Max Skaller
2001-07-17 18:50                   ` Ari Heitner
2001-07-18 22:24                     ` John Max Skaller
2001-07-13 16:12           ` Lyn A Headley
2001-07-13 17:50             ` William Chesters
2001-07-13 16:51           ` Miles Egan
2001-07-13 18:12           ` Jimmie Houchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01071123230712.00523@ice \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).