Version française
Home     About     Download     Resources     Contact us    
Browse thread
question on integrating the toplevel in an O'Caml app
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stephan Houben <stephan@p...>
Subject: question on integrating the toplevel in an O'Caml app
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