caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Tools module for the Standard Lib
@ 2004-12-05 17:36 Tom Hawkins
  2004-12-05 20:23 ` [Caml-list] " Kenneth Knowles
  2004-12-06 10:36 ` Christian Lindig
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Hawkins @ 2004-12-05 17:36 UTC (permalink / raw)
  To: caml-list

Recently I've been reorganizing my build process for Confluence -- it's 
a hardware design language implemented in OCaml.

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.

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:

   let my_ml = Tools.ml_of_file "my.ml" in  (* or ... *)
   let gen_ml = Tools.ml_of_string "print_string \"hello!\"" in

With such a framework, the complexity of the build process is 
encapsulated in a program.  After your process is complete, write out 
the final executable:

   Tools.output_exe some_channel my_compiled_application

Just an idea.

-Tom


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

end of thread, other threads:[~2004-12-06 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-05 17:36 Tools module for the Standard Lib Tom Hawkins
2004-12-05 20:23 ` [Caml-list] " Kenneth Knowles
2004-12-06 10:36 ` Christian Lindig

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