caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* question on integrating the toplevel in an O'Caml app
@ 2000-11-01 15:15 Stephan Houben
  0 siblings, 0 replies; 2+ messages in thread
From: Stephan Houben @ 2000-11-01 15:15 UTC (permalink / raw)
  To: caml-list

Hello list,

At our department, we have currently an application that allows
"Graphical programming", i.e. the user can connect modules (which
act like functions) on the screen with a mouse. It is somewhat similar
to systems like AVS.

Currently, the application is written in C++ and extremely unstable.
It is also not very simple to write new modules, because of all the issues
of memory management, since the user can create, delete, connect
and disconnect modules in an arbitrary order.

I thought that it would be much nicer to have such a system in O'Caml.
Essentially, every graph the user can draw can directly tarnslated
into an O'Caml expression. So I would like to be able to do the
following tasks:

1. Read in a .cmo/.cmi file and find out what functions (and what types)
   are defined in it.
2. Assemble an expression using the functions in .1
3. Type-checking and evaluating the function.

These all seem things the interpreter does now. In the crudest set-up,
I would simply send string to the interpreter. However, a better
approach might be to actually send the AST to the interpreter.

I also need to get the type information. A crude approach would be again
to ask the interpreter to evaluate something like module M = Blah, 
and look at the result. again, I suppose a better approach would be
to get the data structure inside the compiler back.

Finally, it would be nice if some modules could be natively compiled
and statically linked to the application, so as to speed them up.

Any advice you can give before I dive into the toplevel `source?

Stephan

-- 
ir. Stephan H.M.J. Houben
tel. +31-40-2474358 / +31-40-2743497
e-mail: stephanh@win.tue.nl



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

* Re: question on integrating the toplevel in an O'Caml app
@ 2000-11-02 23:35 Ruchira Datta
  0 siblings, 0 replies; 2+ messages in thread
From: Ruchira Datta @ 2000-11-02 23:35 UTC (permalink / raw)
  To: caml-list

Stephan Houben wrote:
>These all seem things the interpreter does now. In the crudest set-up,
>I would simply send string to the interpreter. However, a better
>approach might be to actually send the AST to the interpreter.

>I also need to get the type information. A crude approach would be again
>to ask the interpreter to evaluate something like module M = Blah, 
>and look at the result. again, I suppose a better approach would be
>to get the data structure inside the compiler back.

Have you looked at Camlp4?  It allows users to extend/redefine the
concrete syntax, and IIRC it has some code like what you are looking
for above to facilitate this.

Ruchira Datta
datta@math.berkeley.edu



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

end of thread, other threads:[~2000-11-03  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-01 15:15 question on integrating the toplevel in an O'Caml app Stephan Houben
2000-11-02 23:35 Ruchira Datta

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