caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Max Powers" <max_powers280@hotmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] Calling Ocaml from Python
Date: Thu, 29 Apr 2004 12:39:24 +0930	[thread overview]
Message-ID: <BAY9-F26Ise0xjrUyn7000692e1@hotmail.com> (raw)

This is a bit of a repeat of a question that I posted to comp.lang.python 
(sorry to anyone who was there too!). I'm looking for some advice on 
integrating a python GUI with an OCaml library. (Note: I'm fairly new to 
both ocaml and python; more of a perl and c++ programmer!)

Basically the story is this, I'm building a GUI on the front of an existing 
OCaml tool. I'm writing the GUI in wxPython (there are a number of reasons 
why, I investigated various caml gui toolkits and unfortunately they didn't 
quite satisfy the requirements I had). Currently the GUI is envisaged as a 
glorified configuration file editor; it should help users to generate 
configuration files that are then handed to the ocaml tool to execute.

The problem is this, both the python GUI and the ocaml tool need to know how 
to parse/understand the configuration file format, and I'd like to write the 
parser once (in ocaml, using ocamllex/yacc probably) and use it twice (in 
the GUI and the base tool). My challenge now is to figure out how to call 
the ocaml parser library from python.

I currently have two possibilities in mind. Surfing the web uncovered 
Pycaml, which suggests integration both ways, however from the examples I 
only understand how python can be called from ocaml (not the other way).

The second possibility is to wrap the ocaml module in a c library that can 
then be imported into the python code.

What I'm hoping is that someone on the list has tried this sort of thing 
before and can give a little advice on the best way forwards (and hopefully 
reduce the number of blind alleys I explore!).

Thanks,
Max
(sorry for the length of the message and any abuse of the nomenclature!)

_________________________________________________________________
Personalise your phone with chart ringtones and polyphonics. Go to  
http://ringtones.com.au/ninemsn/control?page=/ninemsn/main.jsp

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


             reply	other threads:[~2004-04-29  3:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-29  3:09 Max Powers [this message]
2004-04-29  3:49 ` skaller
2004-04-29  5:45 ` Basile STARYNKEVITCH
2004-04-29 14:16 ` John Goerzen
2004-04-29  5:07 Max Powers
2004-04-29  5:33 ` skaller
2004-04-29  5:58 Max Powers
2004-04-29  6:56 ` skaller
2004-04-29 21:24 ` art yerkes
2004-04-29  7:42 Max Powers
2004-04-30  1:13 Max Powers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY9-F26Ise0xjrUyn7000692e1@hotmail.com \
    --to=max_powers280@hotmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).