caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin Jambon <martin1977@laposte.net>
To: Richard Jones <rich@annexia.org>
Cc: Denis Bueno <dbueno@gmail.com>, OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Scripting in ocaml
Date: Thu, 21 Dec 2006 15:35:31 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0612211423390.12765@localhost> (raw)
In-Reply-To: <20061221145953.GA24045@furbychan.cocan.org>

On Thu, 21 Dec 2006, Richard Jones wrote:

> On Wed, Dec 20, 2006 at 10:41:20PM -0500, Denis Bueno wrote:
> > I've been writing bash scripts to perform various build- and
> > development-related tasks, and I don't enjoy it. I won't bore you with
> > detailed reasons why. The upshot is that I'd like to script in OCaml.
> >
> > I have considered writing a few camlp4 extensions to make it easier to
> > write scripts:
> >
> >  1) create a syntax which grabs environment variables:
> >
> >    e.g. $FOO would grab the value of the environment variable FOO
> >
> >  2) some sort of more convenient process interaction, e.g., for piping.
>
> I think it's a great idea - I'd love to push OCaml for scripting.
> However I hope your camlp4-fu is up to snuff.  You'd want, as you say,
> a syntax for pipelines and file redirection, but more importantly
> you'd want a very simple syntax for running commands.  So you can
> write some unholy OCaml/sh combination like:
>
>   let nr_files = int_of_string ` ls | wc -l `

It's something that I'd love to have too. An implementation of a
simple subset of sh would be nice. The programming features would be
handled by ocaml, so we need a way to use ocaml variables as
shell variables (of type string, string list or command) in addition to
environment variables.

Should camlp4's quotations be used for this, or should the special syntax
be handled by another preprocessor? I don't know.
A quotation looks like << ls | wc -l >> or <:cmd< ls | wc -l >>.

If something like this already exists, please let us know.
If not, I'd be glad to help design the thing.



Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr


  parent reply	other threads:[~2006-12-21 23:36 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21  3:41 Denis Bueno
2006-12-21  4:34 ` [Caml-list] " Erik de Castro Lopo
2006-12-21  7:22   ` skaller
2006-12-21  9:12     ` Till Varoquaux
2006-12-21  9:18     ` Chad Perrin
2006-12-21 10:29       ` skaller
2006-12-21 20:21         ` Chad Perrin
2006-12-21 13:30     ` Serge Aleynikov
2006-12-21 13:52       ` skaller
2006-12-21 14:59         ` Serge Aleynikov
2006-12-21 20:25           ` Chad Perrin
2006-12-21 20:41             ` Daniel Bünzli
2006-12-21 22:16               ` Chad Perrin
2006-12-22 12:21                 ` strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) Daniel Bünzli
2006-12-22 16:51                   ` Tom
2006-12-22 17:34                     ` Daniel Bünzli
2006-12-22 18:16                     ` skaller
2006-12-22 18:47                       ` Daniel Bünzli
2006-12-22 19:42                         ` skaller
2006-12-22 20:03                           ` David Brown
2006-12-22 20:17                             ` Chad Perrin
2006-12-23  3:48                               ` skaller
2006-12-23  4:11                                 ` Chad Perrin
2006-12-22 20:19                           ` Chad Perrin
2006-12-23 12:58                           ` Daniel Bünzli
2006-12-23 16:06                             ` Chad Perrin
2006-12-23 21:50                               ` Tom
2006-12-26  6:10                                 ` Chad Perrin
2006-12-22 20:14                   ` Chad Perrin
2006-12-21 21:11             ` [Caml-list] Scripting in ocaml Serge Aleynikov
2006-12-21 21:27               ` Philippe Wang
2006-12-21 22:06                 ` Serge Aleynikov
2006-12-22 12:35                 ` Jon Harrop
2006-12-21 22:19               ` Chad Perrin
2006-12-22 12:37                 ` Jon Harrop
2006-12-22 18:52                   ` Chad Perrin
2006-12-22  2:51               ` skaller
2006-12-22 15:20                 ` Jon Harrop
2006-12-22 11:32               ` Jon Harrop
2006-12-23 18:50           ` Jon Harrop
2006-12-24  0:15             ` Serge Aleynikov
2006-12-24  3:30             ` skaller
2006-12-21 14:59 ` Richard Jones
2006-12-21 20:27   ` Chad Perrin
2006-12-21 23:35   ` Martin Jambon [this message]
2006-12-26 17:14 ` Aleksey Nogin
2006-12-26 23:36   ` Ian Zimmerman
2006-12-27 18:25     ` Aleksey Nogin
2006-12-27 18:39       ` Richard Jones
2006-12-27 19:20         ` Aleksey Nogin

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=Pine.LNX.4.58.0612211423390.12765@localhost \
    --to=martin1977@laposte.net \
    --cc=caml-list@inria.fr \
    --cc=dbueno@gmail.com \
    --cc=rich@annexia.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).