* Compiling pycaml shared library
@ 2006-02-03 19:20 Grant Monroe
2006-02-04 14:35 ` [Caml-list] " Richard Jones
2006-02-06 10:38 ` Vsevolod Fedorov
0 siblings, 2 replies; 4+ messages in thread
From: Grant Monroe @ 2006-02-03 19:20 UTC (permalink / raw)
To: caml-list
Hello All,
I'm trying to figure out how to compile a simple shared library (.so)
using pycaml that I can load from the python interpreter. I have a
single .ml file who's contents are as follows:
open Pycaml
let foo_bar_print = pywrap_closure (fun x -> print_endline "hi" ; pynone ()) ;;
let sd = pyimport_getmoduledict () ;;
let mx = pymodule_new "CamlModule" ;;
let cd = pydict_new () ;;
let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;
I'm new to ocaml so basically I want to know what commands to run with
which flags and what libraries need to be linked to and how. Any help
would be appreciated.
Grant Monroe
JanRain, Inc.
P.S. - I tried sending the project creator a message, but the email
address listed on the page seems to have expired.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Compiling pycaml shared library
2006-02-03 19:20 Compiling pycaml shared library Grant Monroe
@ 2006-02-04 14:35 ` Richard Jones
2006-02-06 10:38 ` Vsevolod Fedorov
1 sibling, 0 replies; 4+ messages in thread
From: Richard Jones @ 2006-02-04 14:35 UTC (permalink / raw)
To: Grant Monroe; +Cc: caml-list
On Fri, Feb 03, 2006 at 11:20:41AM -0800, Grant Monroe wrote:
> Hello All,
> I'm trying to figure out how to compile a simple shared library (.so)
> using pycaml that I can load from the python interpreter.
I'm not familiar with pycaml, but mod_caml compiles itself as a .so
file so it can be loaded into Apache. It is only possible with
bytecode (for the moment at least), and the process was very
complicated to figure out. I suggest you start by examining the
makefile:
http://cvs.savannah.nongnu.org/viewcvs/modcaml/Makefile?rev=1.68&root=modcaml&view=markup
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Compiling pycaml shared library
2006-02-03 19:20 Compiling pycaml shared library Grant Monroe
2006-02-04 14:35 ` [Caml-list] " Richard Jones
@ 2006-02-06 10:38 ` Vsevolod Fedorov
2006-02-06 18:10 ` Grant Monroe
1 sibling, 1 reply; 4+ messages in thread
From: Vsevolod Fedorov @ 2006-02-06 10:38 UTC (permalink / raw)
To: Grant Monroe, caml-list
Hello!
> I'm trying to figure out how to compile a simple shared library (.so)
> using pycaml that I can load from the python interpreter. I have a
> single .ml file who's contents are as follows:
I also had to to this task. So I wrote my own library, like py2caml (named
py2caml) - just
to write python extentions on ocaml (without C code).
Unlike pycaml, it can handle multi-threaded apps, safe for user errors in
python or caml code etc.
If you interested I can upload the library to sourceforge, and/or answer
your questions.
Seva
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Compiling pycaml shared library
2006-02-06 10:38 ` Vsevolod Fedorov
@ 2006-02-06 18:10 ` Grant Monroe
0 siblings, 0 replies; 4+ messages in thread
From: Grant Monroe @ 2006-02-06 18:10 UTC (permalink / raw)
To: Vsevolod Fedorov; +Cc: caml-list
Hello Vsevolod,
That would be great. It appears that the pycaml project is no longer
being maintained so py2caml might just fill the void.
Grant Monroe
JanRain, Inc.
On 2/6/06, Vsevolod Fedorov <sevaAtWork@mail.ru> wrote:
> Hello!
>
> > I'm trying to figure out how to compile a simple shared library (.so)
> > using pycaml that I can load from the python interpreter. I have a
> > single .ml file who's contents are as follows:
>
> I also had to to this task. So I wrote my own library, like py2caml (named
> py2caml) - just
> to write python extentions on ocaml (without C code).
> Unlike pycaml, it can handle multi-threaded apps, safe for user errors in
> python or caml code etc.
>
> If you interested I can upload the library to sourceforge, and/or answer
> your questions.
>
> Seva
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-06 18:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-03 19:20 Compiling pycaml shared library Grant Monroe
2006-02-04 14:35 ` [Caml-list] " Richard Jones
2006-02-06 10:38 ` Vsevolod Fedorov
2006-02-06 18:10 ` Grant Monroe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox