* [Caml-list] mod_ocaml @ 2002-12-12 9:14 Maxence Guesdon 2002-12-12 9:32 ` Matt Gushee 2002-12-12 19:10 ` Erik Arneson 0 siblings, 2 replies; 6+ messages in thread From: Maxence Guesdon @ 2002-12-12 9:14 UTC (permalink / raw) To: caml-announce Hello, I've been told about a mod_ocaml for apache, available at http://www.slacky.de/docs/projects/mod_ocaml/ I have not tested it, but I thought a lot of people might be interested. If some of you try it, can you tell us if it works ? Thanks, -- Maxence Guesdon ------------------- 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] 6+ messages in thread
* Re: [Caml-list] mod_ocaml 2002-12-12 9:14 [Caml-list] mod_ocaml Maxence Guesdon @ 2002-12-12 9:32 ` Matt Gushee 2002-12-13 12:20 ` MikhailFedotov 2002-12-12 19:10 ` Erik Arneson 1 sibling, 1 reply; 6+ messages in thread From: Matt Gushee @ 2002-12-12 9:32 UTC (permalink / raw) To: caml-list On Thu, Dec 12, 2002 at 10:14:44AM +0100, Maxence Guesdon wrote: > > I've been told about a mod_ocaml for apache, available at > http://www.slacky.de/docs/projects/mod_ocaml/ > > I have not tested it, but I thought a lot of people might be interested. > If some of you try it, can you tell us if it works ? Well, I haven't built a real application with it, but I have produced a few simple pages, and it worked fine for that. I was a little disappointed because I was hoping for something that allowed using arbitrary OCaml code; mod_ocaml only supports an embedding scripting model: <?ocml <html> do_stuff () ;; </html> ?> but it looks like a good tool for quick-and-dirty dynamic Web sites. -- Matt Gushee When a nation follows the Way, Englewood, Colorado, USA Horses bear manure through mgushee@havenrock.com its fields; http://www.havenrock.com/ When a nation ignores the Way, Horses bear soldiers through its streets. --Lao Tzu (Peter Merel, trans.) ------------------- 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] 6+ messages in thread
* RE: [Caml-list] mod_ocaml 2002-12-12 9:32 ` Matt Gushee @ 2002-12-13 12:20 ` MikhailFedotov 2002-12-13 18:00 ` MikhailFedotov 0 siblings, 1 reply; 6+ messages in thread From: MikhailFedotov @ 2002-12-13 12:20 UTC (permalink / raw) To: caml-list > > I've been told about a mod_ocaml for apache, available at > > http://www.slacky.de/docs/projects/mod_ocaml/ > > > > I have not tested it, but I thought a lot of people might be > > interested. If some of you try it, can you tell us if it works ? > > Well, I haven't built a real application with it, but I have > produced a few simple pages, and it worked fine for that. > > I was a little disappointed because I was hoping for > something that allowed using arbitrary OCaml code; mod_ocaml > only supports an embedding scripting model: > > <?ocml <html> do_stuff () ;; </html> ?> > > but it looks like a good tool for quick-and-dirty dynamic Web sites. It seems that mod_ocaml strips last line of source if there is no newline symbol at the end. I.e. if all your html file is in one line, it disappears... Mikhail ------------------- 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] 6+ messages in thread
* RE: [Caml-list] mod_ocaml 2002-12-13 12:20 ` MikhailFedotov @ 2002-12-13 18:00 ` MikhailFedotov 0 siblings, 0 replies; 6+ messages in thread From: MikhailFedotov @ 2002-12-13 18:00 UTC (permalink / raw) To: caml-list > > > > I was a little disappointed because I was hoping for something that > > allowed using arbitrary OCaml code; mod_ocaml only supports an > > embedding scripting model: > > > > <?ocml <html> do_stuff () ;; </html> ?> > > > > but it looks like a good tool for quick-and-dirty dynamic Web sites. > > It seems that mod_ocaml strips last line of source if there > is no newline symbol at the end. I.e. if all your html file > is in one line, it disappears... BTW, I've looked into the code. I may be wrong, but it seems that there are problems with memory management. Authors think that in C "sizeof(char*)" gives maximum length of string or something like that, so they allocate memory like this: this_arg = (char *) ap_pcalloc(r->pool, sizeof(char *)); Another interesting example that I would not comment: p->key = (char**)ap_pcalloc(r->pool, sizeof (char **) * 255); Nice tool anyway. :-) Mikhail ------------------- 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] 6+ messages in thread
* Re: [Caml-list] mod_ocaml 2002-12-12 9:14 [Caml-list] mod_ocaml Maxence Guesdon 2002-12-12 9:32 ` Matt Gushee @ 2002-12-12 19:10 ` Erik Arneson 2002-12-12 23:45 ` SooHyoung Oh 1 sibling, 1 reply; 6+ messages in thread From: Erik Arneson @ 2002-12-12 19:10 UTC (permalink / raw) To: Maxence Guesdon; +Cc: caml-announce On 12 December 2002, Maxence Guesdon <maxence.guesdon@inria.fr> wrote: > I've been told about a mod_ocaml for apache, available at > http://www.slacky.de/docs/projects/mod_ocaml/ > > I have not tested it, but I thought a lot of people might be interested. > If some of you try it, can you tell us if it works ? It works just fine! It is a nice module for quick dynamic web pages, like Mr Gushee pointed out, but I think there are a few changes that could be made to make it safer and more robust for bigger applications. First, it would be neat if there were a safer way to grab and validate the query string. A string replacement just doesn't work very well, and it prints out an error if certain query string arguments aren't found, so there's no easy way to just search for their existence. There are some OCaml modules out there to handle this, though, and I believe the QUERY_STRING environment variable is still available for parsing. Second, the OCaml interpreter is called every hit, which probably isn't very scalable. It would be really neat if the embedded OCaml page were compiled to byte code and stored in memory somehow, so perhaps the OCaml bytecode interpreter could only be called once. Mod_perl does something like this, and it seems to work very well. The latter is a pretty big project, though. I would have no idea where to start, and I think mod_ocaml is a pretty neat beginning in any case! -- ;; Erik Arneson <erik@aarg.net> AARG Net <http://www.aarg.net/> ;; ;; GPG Key ID: 2048R/8B4CBC9C <http://erik.arneson.org/> ;; ;; "Resistance to tyrants is obedience to God!" - Thomas Jefferson ;; ------------------- 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] 6+ messages in thread
* Re: [Caml-list] mod_ocaml 2002-12-12 19:10 ` Erik Arneson @ 2002-12-12 23:45 ` SooHyoung Oh 0 siblings, 0 replies; 6+ messages in thread From: SooHyoung Oh @ 2002-12-12 23:45 UTC (permalink / raw) To: Maxence Guesdon, Erik Arneson; +Cc: caml-announce Ocaml Server Pages seems to have some of your reqirments. First, it receives and parses the query string. Second, it compiles the ocaml script and execute the binary. If someone has time to combine these two tools, it'll be great, isn't it? ps: You can download osp from http://www.rogare.com/index.php?inc=downloads/ocaml/ocaml, and you can download some fixes and view examples from http://www.taglib.co.kr/ocaml/index.html --- SooHyoung Oh http://www.taglib.co.kr/shoh.html ----- Original Message ----- From: "Erik Arneson" <erik@aarg.net> To: "Maxence Guesdon" <maxence.guesdon@inria.fr> Cc: <caml-announce@inria.fr> Sent: Friday, December 13, 2002 4:10 AM Subject: Re: [Caml-list] mod_ocaml > On 12 December 2002, Maxence Guesdon <maxence.guesdon@inria.fr> wrote: > > I've been told about a mod_ocaml for apache, available at > > http://www.slacky.de/docs/projects/mod_ocaml/ > > > > I have not tested it, but I thought a lot of people might be interested. > > If some of you try it, can you tell us if it works ? > > It works just fine! It is a nice module for quick dynamic web pages, > like Mr Gushee pointed out, but I think there are a few changes that > could be made to make it safer and more robust for bigger applications. > > First, it would be neat if there were a safer way to grab and validate > the query string. A string replacement just doesn't work very well, and > it prints out an error if certain query string arguments aren't found, > so there's no easy way to just search for their existence. There are > some OCaml modules out there to handle this, though, and I believe the > QUERY_STRING environment variable is still available for parsing. > > Second, the OCaml interpreter is called every hit, which probably isn't > very scalable. It would be really neat if the embedded OCaml page were > compiled to byte code and stored in memory somehow, so perhaps the OCaml > bytecode interpreter could only be called once. Mod_perl does something > like this, and it seems to work very well. > > The latter is a pretty big project, though. I would have no idea where > to start, and I think mod_ocaml is a pretty neat beginning in any case! > > -- > ;; Erik Arneson <erik@aarg.net> AARG Net <http://www.aarg.net/> ;; > ;; GPG Key ID: 2048R/8B4CBC9C <http://erik.arneson.org/> ;; > ;; "Resistance to tyrants is obedience to God!" - Thomas Jefferson ;; > > > ------------------- > 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 > ------------------- 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] 6+ messages in thread
end of thread, other threads:[~2002-12-13 18:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-12-12 9:14 [Caml-list] mod_ocaml Maxence Guesdon 2002-12-12 9:32 ` Matt Gushee 2002-12-13 12:20 ` MikhailFedotov 2002-12-13 18:00 ` MikhailFedotov 2002-12-12 19:10 ` Erik Arneson 2002-12-12 23:45 ` SooHyoung Oh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox