caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Kenneth Knowles <kknowles@soe.ucsc.edu>
To: Tom Hawkins <tom@confluent.org>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Tools module for the Standard Lib
Date: Sun, 5 Dec 2004 12:23:47 -0800	[thread overview]
Message-ID: <20041205202346.GA21394@tallman.ucsc.edu> (raw)
In-Reply-To: <41B34705.4000207@confluent.org>

On Sun, Dec 05, 2004 at 11:36:05AM -0600, Tom Hawkins wrote:
> A few days ago a Confluence user made an interesting suggestion: why not 
> use OCaml to build OCaml applications?  He then proceeded to write an 
> OCaml script to generate the lexers and parsers, compile the interfaces 
> and implementations, then link everything together.

I did a similar thing with ocamlconf (currently don't have time to maintain it,
though), except it generates a Makefile from a high-level spec.  I think getting
the "make" logic into O'Caml is the right way to go, and it'll make it easier to
experiment with different build strategies, such as the fixpoint iteration
Skaller has brought up, or some constraint->action (a la Dijkstra's guarded
commands) approach that would subsume fixpoint and traditional make.
 
> Extrapolating on this idea, it would be advantageous to have a "Tools" module
> in the standard library to provide an interface to ocamlc, 
> ocamlopt, ocamllex, ocamlyacc, ocamldep, and all the other tools.  Such 
> a module would provide first-class ADTs for data that is currently 
> represented in files: .ml, .mli, .mll, .cmi, .cmx, etc.  For example:

Sounds like a polyvalent program:
http://www.catb.org/~esr/writings/taoup/html/ch11s07.html#id2960228

I think this is an admirably flexible way to design tools of all sorts, but it
might force too much stability on the compiler's internals.  A user could
implement this module using tempfiles and storing whole file contents in
memory.. actually I guess there'd be a problem parsing reasonable exceptions
from the error messages...

- Kenn

p.s. As far as the details, I think "*_of_filename" functions are misguided, and
"*_of_channel" is more appropriate.


  reply	other threads:[~2004-12-05 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-05 17:36 Tom Hawkins
2004-12-05 20:23 ` Kenneth Knowles [this message]
2004-12-06 10:36 ` [Caml-list] " Christian Lindig

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=20041205202346.GA21394@tallman.ucsc.edu \
    --to=kknowles@soe.ucsc.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=tom@confluent.org \
    /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).