From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA21853; Wed, 11 Jul 2001 23:23:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA21705 for ; Wed, 11 Jul 2001 23:23:40 +0200 (MET DST) Received: from moutvdom01.kundenserver.de (moutvdom01.kundenserver.de [195.20.224.200]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f6BLNeX25682 for ; Wed, 11 Jul 2001 23:23:40 +0200 (MET DST) Received: from [195.20.224.208] (helo=mrvdom01.kundenserver.de) by moutvdom01.kundenserver.de with esmtp (Exim 2.12 #2) id 15KRSN-00031w-00 for caml-list@inria.fr; Wed, 11 Jul 2001 23:23:39 +0200 Received: from drms-3e364b90.pool.mediaways.net ([62.54.75.144] helo=ice.gerd-stolpmann.de) by mrvdom01.kundenserver.de with esmtp (Exim 2.12 #2) id 15KRSN-00013I-00 for caml-list@inria.fr; Wed, 11 Jul 2001 23:23:39 +0200 Received: from localhost (localhost [[UNIX: localhost]]) by ice.gerd-stolpmann.de (8.9.3/8.9.3) id XAA04458 for caml-list@inria.fr; Wed, 11 Jul 2001 23:23:08 +0200 From: Gerd Stolpmann Reply-To: info@gerd-stolpmann.de Organization: privat To: caml-list@inria.fr Subject: RE: [Caml-list] Web Development with OCaml Date: Wed, 11 Jul 2001 22:44:53 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01071123230712.00523@ice> Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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< This is $aAnd this is $b >> let table rows = <:xml<
>> 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