caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Ocaml server pages?
@ 2004-10-01 15:50 Charles Sutton
  2004-10-01 16:04 ` Richard Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Sutton @ 2004-10-01 15:50 UTC (permalink / raw)
  To: caml-list

I've seen a few references in the list archives to an interesting 
package
called Ocaml sever pages.  But the links in those messages no longer 
work,
and Google is unhelpful.  Does anyone know if this package is still
available?

Thanks,
-- 
Charles Sutton * casutton@cs.umass.edu * 
http://www.cs.umass.edu/~casutton/
Information Extraction and Synthesis Laboratory * University of 
Massachusetts

-------------------
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/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Ocaml server pages?
  2004-10-01 15:50 [Caml-list] Ocaml server pages? Charles Sutton
@ 2004-10-01 16:04 ` Richard Jones
  2004-10-01 18:03   ` Nicolas Cannasse
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Jones @ 2004-10-01 16:04 UTC (permalink / raw)
  To: Charles Sutton; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

On Fri, Oct 01, 2004 at 11:50:02AM -0400, Charles Sutton wrote:
> I've seen a few references in the list archives to an interesting 
> package
> called Ocaml sever pages.  But the links in those messages no longer 
> work,
> and Google is unhelpful.  Does anyone know if this package is still
> available?

The description of it I found makes it sound a lot to me like
mod_Ocaml (note the *O*caml, not to be confused with mod_caml).  The
latest references I can find to mod_Ocaml are here:

http://www.slacky.de/docs/projects/mod_ocaml/
http://freshmeat.net/projects/modocaml/

Note that there are at least 4 different ways to do web stuff with
OCaml, all with their own pros and cons.  At some point I intend to
write up a summary, but in the meantime, here are the three (other)
packages in no particular order.  You can go to their web pages and
read about them:

asxcaml			http://www.asxcaml.org/
ocamlnet		http://ocamlnet.sourceforge.net/
mod_caml		http://www.merjis.com/developers/mod_caml/

(Note that I am the author of the last one, mod_caml).

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Ocaml server pages?
  2004-10-01 16:04 ` Richard Jones
@ 2004-10-01 18:03   ` Nicolas Cannasse
  2004-10-03 20:45     ` Richard Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Cannasse @ 2004-10-01 18:03 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

> Note that there are at least 4 different ways to do web stuff with
> OCaml, all with their own pros and cons.  At some point I intend to
> write up a summary, but in the meantime, here are the three (other)
> packages in no particular order.  You can go to their web pages and
> read about them:

Could you quickly sum up theses differences for this list readers ?
I'm recently interested in high level server side languages.
Any hint to show me what's "best" is apprecied.

Regards,
Nicolas Cannasse

-------------------
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/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Ocaml server pages?
  2004-10-01 18:03   ` Nicolas Cannasse
@ 2004-10-03 20:45     ` Richard Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Jones @ 2004-10-03 20:45 UTC (permalink / raw)
  Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 4779 bytes --]

On Fri, Oct 01, 2004 at 08:03:39PM +0200, Nicolas Cannasse wrote:
> > Note that there are at least 4 different ways to do web stuff with
> > OCaml, all with their own pros and cons.  At some point I intend to
> > write up a summary, but in the meantime, here are the three (other)
> > packages in no particular order.  You can go to their web pages and
> > read about them:
> 
> Could you quickly sum up theses differences for this list readers ?
> I'm recently interested in high level server side languages.
> Any hint to show me what's "best" is apprecied.

I'm not going to claim that any of the four approaches is best, but I
will try to summarise them as far as my understanding goes.  Please
don't flame me too much for this; and do also note that I am the
author of mod_caml.

** mod_caml

mod_caml sits inside the Apache process, and its strengths and
limitations derive from this fact.  Because it's inside the process,
it has full access to the Apache API, which means that you can, for
example, make subrequests, or write an authentication handler, or
write a more sane URL mapping system than mod_rewrite, or [coming
soon, with Apache 2.0] use OCaml code to post-process the output of
some other CGI script written in another language.

It's completely tied to Apache.  You have no other webserver choice
once you've decided to use mod_caml.

Apache preforks itself, so there are actually several instances of
your code running, in separate processes, all working on separate HTTP
requests.

Because it uses Dynlink to load code, you can only use bytecode.  (I
would argue that most web applications are heavily IO bound, so this
isn't a problem.  But I can certainly imagine some compute-intensive
application, or part of an application, where the lack of native
compilation would be a serious shortcoming).

It doesn't use Gerd's Netcgi module, but instead uses its own which is
basically a reimplementation of Perl's Cgi.pm in OCaml.  This is good
news for ex-Perl refugees like me, of course.  mod_caml itself is
independent of ocamlnet, but I personally use quite a lot of ocamlnet
functions.  The 2.0 release of COCANWIKI will depend on ocamlnet for
URL parsing, generating and parsing MIME emails, and maybe other
stuff.

It comes with a template library to enforce correct separation of code
and HTML.  You can see this in action by grabbing the COCANWIKI 1.0
distribution from http://sandbox.merjis.com/ and comparing the
scripts/ and templates/ directories.

** ocamlnet & asxcaml

ocamlnet runs outside the web server, using either FastCGI or JSERV to
communicate with the web server.  (Or you can run your scripts as
ordinary CGI external programs, but I wouldn't recommend that for
serious use).  Your program is linked together into a single binary
which, when started, is a FastCGI or JSERV server, and processes
requests either sequentially or by forking a new process for each
request.  The webserver then acts as a proxy between the browser and
your program.

There are two important consequences of this: (1) You can use native
code. (2) Your whole program is compiled together a single unit.

There's no templating or database access, but you could easily add
these by using mod_caml's templating system or CamlTemplate, and
ocamldbi respectively.

AS/XCaml is built on top of ocamlnet, and I'm not going to claim to
fully understand it or even to have used it.  However the big feature
is the statically typed SQL implementation.  This is a big improvement
over ocamldbi (which can throw type errors at runtime if your database
returns a field with an unexpected type).  The reason I didn't do this
for ocamldbi was because it would involve fully parsing every variant
of SQL and/or limiting the complexity of SQL queries permitted.
AS/XCaml uses an XML file to describe your database schema, and from
this (I'm guessing) derives the schema and queries.  In concept this
is very similar to PDL
[http://www.redhat.com/docs/manuals/waf/rhea-dg-waf-en-6.1/s1-pers-pdl.html].

** mod_ocaml

This is another Apache module.  It's similar in concept to JSP or PHP.
You actually embed OCaml code into your webpage.  The webpage is then
compiled (with ocamlc) and run on the fly.  Your OCaml code prints
HTML.

Having worked in a professional web applications outfit for a few
years, I can't in all conscience recommend embedding code into web
pages which designers might try to edit.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Learning Objective CAML for C, C++, Perl and Java programmers:
http://www.merjis.com/richj/computers/ocaml/tutorial/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-03 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-01 15:50 [Caml-list] Ocaml server pages? Charles Sutton
2004-10-01 16:04 ` Richard Jones
2004-10-01 18:03   ` Nicolas Cannasse
2004-10-03 20:45     ` Richard Jones

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).