Browse thread
embedding ocaml into a windows app: need gcc?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2008-10-03 (21:58) |
From: | Lukasz Stafiniak <lukstafi@g...> |
Subject: | Re: [Caml-list] 'Compiler' module (was: embedding ocaml into a windows app: need gcc?) |
On Fri, Oct 3, 2008 at 11:34 PM, Dawid Toton <d0@wp.pl> wrote: > >> I would like an OCaml support library that can compile and execute >> similar to JaveScript engines, but we don't have that in any practical >> form. >> > > I also need this and I'm thinking about something like this: > > module type Compiler = > sig > val parse : Context.t -> string -> (Context.t * AST.t) > val get_type : Context.t -> AST.t -> Type.t; > val eval : Context.t -> AST.t -> Context.t * (Type.t * > MarshalledValueOrSomething.t) > end > > Is it really so hard to have it in OCaml? I'm envy of Python's Compiler > module. > > It could solve some of my problems, in particular for my 'parallel-like' > evaluation ( > http://www.nabble.com/'Nondeterministic'-evaluation-wrt-exceptions-td18653998.html > ). After some experimentation I know that I need type information during > code transformation. I want to create a sort of interpreter. > > That Compiler module would also enable me to have an editor with graphical > representation of results intermixed with code (like Mathematica's > notebook). > > Where to look for suitable pieces of code? AFAIK camlp4 modules can't tell > me type of anything. Should I start digging in OCaml compiler sources? > You will be better off starting digging in MetaOCaml compiler sources :-)