caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Embedding OCaml
@ 2004-02-20 17:05 Vlad Seryakov
  2004-02-20 17:25 ` Richard Jones
  2004-02-22 12:09 ` clement
  0 siblings, 2 replies; 9+ messages in thread
From: Vlad Seryakov @ 2004-02-20 17:05 UTC (permalink / raw)
  To: caml-list

Hello,

I am trying to embedd OCaml into Aolserver as second interpreter. 
Aolserver is multithreaded web server which uses Tcl
as scripting language. Requestes are processed concurrently by calling 
Tcl scripts. My intention is to add OCaml
to Aolserver so web pages written in Caml can be used for web programming.

My question is, is it safe to use OCaml in such environment where many 
different OCaml scripts can be executed.
I use Dynalink pacjage for dynamically loading object .cmo files.

Thank you

-- 
Vlad Seryakov
703 961-5433 office
vlad@crystalballinc.com
http://www.crystalballinc.com/vlad/

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:05 [Caml-list] Embedding OCaml Vlad Seryakov
@ 2004-02-20 17:25 ` Richard Jones
  2004-02-20 17:34   ` Vlad Seryakov
  2004-02-22 12:09 ` clement
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Jones @ 2004-02-20 17:25 UTC (permalink / raw)
  To: Vlad Seryakov; +Cc: caml-list

On Fri, Feb 20, 2004 at 12:05:30PM -0500, Vlad Seryakov wrote:
> Hello,
> 
> I am trying to embedd OCaml into Aolserver as second interpreter. 
> Aolserver is multithreaded web server which uses Tcl
> as scripting language. Requestes are processed concurrently by calling 
> Tcl scripts. My intention is to add OCaml
> to Aolserver so web pages written in Caml can be used for web programming.
> 
> My question is, is it safe to use OCaml in such environment where many 
> different OCaml scripts can be executed.

Have a look at this posting:

http://caml.inria.fr/archives/200308/msg00258.html

> I use Dynalink pacjage for dynamically loading object .cmo files.

Dynlink is very fussy.  I had lots of problems with it.  You might
like to look at mod_caml for ideas.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,
RPMs, pkgs etc. Linux, BSD, Solaris. http://www.annexia.org/freeware/makeplus/

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:25 ` Richard Jones
@ 2004-02-20 17:34   ` Vlad Seryakov
  2004-02-20 17:35     ` Ranjan Bagchi
  2004-02-20 17:43     ` Richard Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Vlad Seryakov @ 2004-02-20 17:34 UTC (permalink / raw)
  Cc: caml-list

Thanks

Actually i checked mod_caml and used many great ideas from it. I have my 
module
working fine and actually i do not use separate executable as mod_caml 
does. i was able to put Caml bytecode
runtime into shared library and give that shared library to caml_main on 
startup, so Dynalink is happy as well.
I have douts about multithreading, source code does not have anything, 
so mutex around callbacks the only solution,
which means it cannot be used in very busy web servers because 
concurrency will be an issue.

Richard Jones wrote:
> On Fri, Feb 20, 2004 at 12:05:30PM -0500, Vlad Seryakov wrote:
> 
>>Hello,
>>
>>I am trying to embedd OCaml into Aolserver as second interpreter. 
>>Aolserver is multithreaded web server which uses Tcl
>>as scripting language. Requestes are processed concurrently by calling 
>>Tcl scripts. My intention is to add OCaml
>>to Aolserver so web pages written in Caml can be used for web programming.
>>
>>My question is, is it safe to use OCaml in such environment where many 
>>different OCaml scripts can be executed.
> 
> 
> Have a look at this posting:
> 
> http://caml.inria.fr/archives/200308/msg00258.html
> 
> 
>>I use Dynalink pacjage for dynamically loading object .cmo files.
> 
> 
> Dynlink is very fussy.  I had lots of problems with it.  You might
> like to look at mod_caml for ideas.
> 
> Rich.
> 

-- 
Vlad Seryakov
703 961-5433 office
vlad@crystalballinc.com
http://www.crystalballinc.com/vlad/

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:34   ` Vlad Seryakov
@ 2004-02-20 17:35     ` Ranjan Bagchi
  2004-02-20 17:43     ` Richard Jones
  1 sibling, 0 replies; 9+ messages in thread
From: Ranjan Bagchi @ 2004-02-20 17:35 UTC (permalink / raw)
  To: Vlad Seryakov; +Cc: caml-list

Sounds like we're looking at roughly the same thing.  I'm trying to get
some toy projects working with mod_caml CGI's talking to RPC servers --
which is a pretty much proven design from the J2EE world.

Another option is to use OcamlSpread -- which would enable a messaging
architecture (which should be able to scale better than RPC, FWIW)

Ranjan

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:34   ` Vlad Seryakov
  2004-02-20 17:35     ` Ranjan Bagchi
@ 2004-02-20 17:43     ` Richard Jones
  2004-02-20 17:54       ` Vlad Seryakov
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Jones @ 2004-02-20 17:43 UTC (permalink / raw)
  To: Vlad Seryakov; +Cc: caml-list

On Fri, Feb 20, 2004 at 12:34:12PM -0500, Vlad Seryakov wrote:
> Thanks
> 
> Actually i checked mod_caml and used many great ideas from it. I have my 
> module
> working fine and actually i do not use separate executable as mod_caml 
> does. i was able to put Caml bytecode
> runtime into shared library and give that shared library to caml_main on 
> startup, so Dynalink is happy as well.

Can you show me how you did this?  I'm very interested.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
If I have not seen as far as others, it is because I have been
standing in the footprints of giants.  -- from Usenet

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:43     ` Richard Jones
@ 2004-02-20 17:54       ` Vlad Seryakov
  2004-02-20 18:06         ` Richard Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Vlad Seryakov @ 2004-02-20 17:54 UTC (permalink / raw)
  Cc: caml-list

Sure, sorry

Module can be downloaded from http://www.crystalballinc.com/vlad/software/

Richard Jones wrote:
> On Fri, Feb 20, 2004 at 12:34:12PM -0500, Vlad Seryakov wrote:
> 
>>Thanks
>>
>>Actually i checked mod_caml and used many great ideas from it. I have my 
>>module
>>working fine and actually i do not use separate executable as mod_caml 
>>does. i was able to put Caml bytecode
>>runtime into shared library and give that shared library to caml_main on 
>>startup, so Dynalink is happy as well.
> 
> 
> Can you show me how you did this?  I'm very interested.
> 
> Rich.
> 

-- 
Vlad Seryakov
703 961-5433 office
vlad@crystalballinc.com
http://www.crystalballinc.com/vlad/

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:54       ` Vlad Seryakov
@ 2004-02-20 18:06         ` Richard Jones
  2004-02-21  2:17           ` ChoJin
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Jones @ 2004-02-20 18:06 UTC (permalink / raw)
  To: Vlad Seryakov; +Cc: caml-list

On Fri, Feb 20, 2004 at 12:54:48PM -0500, Vlad Seryakov wrote:
> Sure, sorry
> 
> Module can be downloaded from http://www.crystalballinc.com/vlad/software/

Ah, I see ... clever!  I'll be borrowing that for 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
http://www.YouUnlimited.co.uk/ - management courses

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 18:06         ` Richard Jones
@ 2004-02-21  2:17           ` ChoJin
  0 siblings, 0 replies; 9+ messages in thread
From: ChoJin @ 2004-02-21  2:17 UTC (permalink / raw)
  To: Richard Jones; +Cc: Vlad Seryakov, caml-list

Richard Jones <rich@annexia.org> writes:

> On Fri, Feb 20, 2004 at 12:54:48PM -0500, Vlad Seryakov wrote:
>> Sure, sorry
>> 
>> Module can be downloaded from http://www.crystalballinc.com/vlad/software/
>
> Ah, I see ... clever!  I'll be borrowing that for mod_caml ...

Or if you want to execute plain ocaml source, maybe you can use the
module Toploop.

For instance, using

Toploop.run_script Format.str_formatter "./foo.ml" [| "./foo.ml" |];;

PS: Btw, why is this module not documented ? I have just discovered it
while reading the cameleon toplevel source code. But I don't find it
in the html documentation.

-- 
Best Regards
ChoJin

-------------------
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] 9+ messages in thread

* Re: [Caml-list] Embedding OCaml
  2004-02-20 17:05 [Caml-list] Embedding OCaml Vlad Seryakov
  2004-02-20 17:25 ` Richard Jones
@ 2004-02-22 12:09 ` clement
  1 sibling, 0 replies; 9+ messages in thread
From: clement @ 2004-02-22 12:09 UTC (permalink / raw)
  To: caml-list



Hello,

I have got another solution to possibly resolve this
problem: 
I've developed an embedded O'Caml toplevel
which integrates the runtime and the compiler of O'Caml.
Actually, it's a dynamic linked library (in C) builds using 
the "ouput-obj" option; i have solved the problem of 
the symbole table thanks to a modification of the 
compiler and the runtime.

you can download the patch at this url: 
http://www.pps.jussieu.fr/~capel/eng/toplevel/toplevel.html

you will find also an O'Caml plugin for Excel and Netscape in this page.


Just an example to show you how it works (in C):
(you can also use the directives #use and #load)

  toplevel_init(argv);

  toplevel_exec("let rec ack m n = 
                 match m,n with 0,n -> n+1            
               | m,0 -> ack (m-1) 1                   
               | m,n -> (ack (m-1) ack m (n-1))");
    
  val = toplevel_exec("ack 3 2;;");
  res = 1+Long_val(val);

  printf ("1+ack(3,2)=%dn", res);


I hope it will help you.


              Clément Capel

-------------------
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] 9+ messages in thread

end of thread, other threads:[~2004-02-22 12:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-20 17:05 [Caml-list] Embedding OCaml Vlad Seryakov
2004-02-20 17:25 ` Richard Jones
2004-02-20 17:34   ` Vlad Seryakov
2004-02-20 17:35     ` Ranjan Bagchi
2004-02-20 17:43     ` Richard Jones
2004-02-20 17:54       ` Vlad Seryakov
2004-02-20 18:06         ` Richard Jones
2004-02-21  2:17           ` ChoJin
2004-02-22 12:09 ` clement

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