caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dawid Toton <d0@wp.pl>
To: caml-list@yquem.inria.fr
Subject: 'Compiler' module (was: embedding ocaml into a windows app: need gcc?)
Date: Fri, 03 Oct 2008 22:34:15 +0100	[thread overview]
Message-ID: <48E68FD7.7040605@wp.pl> (raw)
In-Reply-To: <caee5ad80809271553yeaaa57fqaf0f66047f742aac@mail.gmail.com>


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

Dawid


  reply	other threads:[~2008-10-03 21:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27 19:27 embedding ocaml into a windows app: need gcc? Joel Reymont
2008-09-27 19:48 ` [Caml-list] " Richard Jones
2008-09-27 19:52 ` David Teller
2008-09-27 22:53 ` Mikkel Fahnøe Jørgensen
2008-10-03 21:34   ` Dawid Toton [this message]
2008-10-03 21:58     ` [Caml-list] 'Compiler' module (was: embedding ocaml into a windows app: need gcc?) Lukasz Stafiniak
2008-10-03 22:23     ` David Teller
2008-10-04  2:39     ` Jon Harrop
2008-10-06 17:15       ` [Caml-list] 'Compiler' module Dawid Toton

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=48E68FD7.7040605@wp.pl \
    --to=d0@wp.pl \
    --cc=caml-list@yquem.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).