caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
@ 2004-03-03  1:47 Kenneth Knowles
  2004-03-03  5:16 ` Issac Trotts
  2004-03-11 11:09 ` Markus Mottl
  0 siblings, 2 replies; 9+ messages in thread
From: Kenneth Knowles @ 2004-03-03  1:47 UTC (permalink / raw)
  To: caml-list

Hello caml-list,

I have two projects that I haven't polished to a release state, but I'm hoping
someone might be interested in, so I'm offering access via darcs
(http://www.abridgegame.org/darcs)

(1) ocamlconf
Ocamlconf is like autoconf but much simpler, utterly ocaml-centric, and
dependent on findlib.

You can get it via the command
	'darcs get http://kefka.frap.net:8080/~kenn/repos/ocamlconf'

What it is/does:
*	An autoconf-like tool but using ocaml scripts instead of m4
*	It uses the ocaml toplevel instead of bytecode for cross-version
	compatability
*	Outputs a makefile and a simple config.ml
*	It is _extremely_ simple to use, especially if your projects are 100% ocaml,
	like mine.  (A configure.ml comparable to a configure.ac might be 100
	lines for a complex project)

Why I didn't use autotools/ocamlmakefile/...:
*	autotools are pretty C centric, and more of a pain than necessary for
	an ocaml project which already limits its audience to more-or-less modern
	users.  GNU must support very arcane and archaic setups, but ocamlconf aims
	to suport "anything with ocaml"
*	anyone building an ocaml package with have the toplevel already
*	OcamlMakefile is awkward with multiple targets (such as suites of utilities)
	and I'd rather write (or depend on) a simple ocaml script than a complex 
	Makefile
*	And of course, I did it to see if I could make something simple and useful
	for myself - I've succeeded, as it is what I use for 100% of my ocaml
	projects

(2) ASPCC 
ASPCC started as a little project to robustly parse VbScript, for practice.
Then with the abstract syntax tree I tried to output equivalent PHP scripts.  I
got pretty far on that, and decided I needed to run the VbScript in order to do
unit-test comparisons between it and the PHP.  Here is what it is now:

You can get it via the command
	'darcs get http://kefka.frap.net:8080/~kenn/repos/aspcc'

*	A naively simple ASP interpreter that still appears to be more than 
	competitive in speed with MS ASP, but needs more DB support to run
	real-world apps.  It does, however, support all VbScript syntax.

*	Support for running .asp files under Apache.  No mod_caml support yet, but
	it runs as a CGI and is not at a point

*	An incomplete bytecode compiler and VM.  I made up a new bytecode instead of
	using ocaml or Java because VbScript has really really weird semantics 
	sometimes.  Also I want to try my hand at a little virtual machine for fun.

Again, the disclaimers:  I hate VbScript, but I program it because my company
has a huge ASP codebase, and I love the people here; they are just a little
change-wary.  There are other VbScript / ASP solutions, but all of them are
incomplete in different ways, have different focuses, and are written in
languages that I'm not really interested in using.

Thanks for reading if you made it through all that,

Kenn

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03  1:47 [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC Kenneth Knowles
@ 2004-03-03  5:16 ` Issac Trotts
  2004-03-03  6:25   ` Kenneth Knowles
  2004-03-11 11:09 ` Markus Mottl
  1 sibling, 1 reply; 9+ messages in thread
From: Issac Trotts @ 2004-03-03  5:16 UTC (permalink / raw)
  To: caml-list

On Tue, Mar 02, 2004 at 05:47:57PM -0800, Kenneth Knowles wrote:
> Hello caml-list,
> 
> I have two projects that I haven't polished to a release state, but I'm hoping
> someone might be interested in, so I'm offering access via darcs
> (http://www.abridgegame.org/darcs)
> 
> (1) ocamlconf
> Ocamlconf is like autoconf but much simpler, utterly ocaml-centric, and
> dependent on findlib.
> 
> You can get it via the command
> 	'darcs get http://kefka.frap.net:8080/~kenn/repos/ocamlconf'

I guess you mean David's Advanced Revision Control System.  I had never
heard of this before your post.  There is no Debian package for this,
though it looks like a useful program.  

I wonder if Darcs could be modified to explicitly keep track of changes
to the ASTs of OCaml source files...

> What it is/does:
> *	An autoconf-like tool but using ocaml scripts instead of m4
> *	It uses the ocaml toplevel instead of bytecode for cross-version
> 	compatability
> *	Outputs a makefile and a simple config.ml

Could it output an OCaml script instead of a makefile?  It would
probably be easier to read, debug, and modify.

> *	It is _extremely_ simple to use, especially if your projects are 100% ocaml,
> 	like mine.  (A configure.ml comparable to a configure.ac might be 100
> 	lines for a complex project)
> 
> Why I didn't use autotools/ocamlmakefile/...:
> *	autotools are pretty C centric, and more of a pain than necessary for
> 	an ocaml project which already limits its audience to more-or-less modern
> 	users.  GNU must support very arcane and archaic setups, but ocamlconf aims
> 	to suport "anything with ocaml"
> *	anyone building an ocaml package with have the toplevel already
> *	OcamlMakefile is awkward with multiple targets (such as suites of utilities)
> 	and I'd rather write (or depend on) a simple ocaml script than a complex 
> 	Makefile
> *	And of course, I did it to see if I could make something simple and useful
> 	for myself - I've succeeded, as it is what I use for 100% of my ocaml
> 	projects

Thank you!

-- 
Issac Trotts
http://redwood.ucdavis.edu/~issac

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03  5:16 ` Issac Trotts
@ 2004-03-03  6:25   ` Kenneth Knowles
  2004-03-03 19:53     ` Issac Trotts
  2004-03-03 19:56     ` David MENTRE
  0 siblings, 2 replies; 9+ messages in thread
From: Kenneth Knowles @ 2004-03-03  6:25 UTC (permalink / raw)
  To: ijtrotts, caml-list

Sorry if I wasn't clear about this:

> I guess you mean David's Advanced Revision Control System. 

DARCS is very nice; if you are familiar with Tom Lord's arch, consider a similar
design, but many fewer commands and simpler usage - this may or may not be ideal
for you.  I also gain a lot of confidence from DARCS being written in Haskell.

> There is no Debian package for this,
> though it looks like a useful program.  

>From the DARCS webpage:
----------------------

Debian users

If you use debian, you can install darcs via apt. For woody, add the following
lines to your sources.list: 

deb http://http.abridgegame.org/debian/ woody/
deb-src http://http.abridgegame.org/debian/ woody/ 

If you are running woody, and want to compile darcs yourself, you may want to
add the following line as well, which provides a ghc compiler that is
sufficiently recent to compile darcs: 

deb http://www.syntaxpolice.org/haskell-experimental/ stable/

If you are running sid (Debian unstable), you can instead use the following
lines: 

deb http://http.abridgegame.org/debian/ unstable/
deb-src http://http.abridgegame.org/debian/ unstable/ 
 
> I wonder if Darcs could be modified to explicitly keep track of changes
> to the ASTs of OCaml source files...

Now this sounds interesting!  Someone very ambitious could invent a source
control item with plugins for parsing different languages, and diffing the
trees.
 
> Could it output an OCaml script instead of a makefile?  It would
> probably be easier to read, debug, and modify.

I phrased this badly.  What you want, is what it does, I think.  I should have
said that it "outputs a configure script, which when run outputs a makefile and
config.ml"

I will quickly explain all of what it does.

(1)	You write configure.ml, somewhat analogous to configure.ac
(2)	You run ocamlconf, it creates a configure script
----
(3) The end user/you run the configure script - it outputs a makefile and/or
    configuration summary ocaml file.
(4) make && make install

Every stage is easy to debug - your configure.ml script is a simple ocaml
script.  The configure script (actually configure.mlc, for technical reasons,
and the configure script is a shell wrapper around `ocaml configure.mlc`) is
also plain text ocaml, but with additional code copied into it.  And even the
makefile is about as simple as possible for your project, so hopefully bugs in
ocamlconf will easily be discovered.

Kenn

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03  6:25   ` Kenneth Knowles
@ 2004-03-03 19:53     ` Issac Trotts
  2004-03-03 23:06       ` Kenneth Knowles
  2004-03-03 19:56     ` David MENTRE
  1 sibling, 1 reply; 9+ messages in thread
From: Issac Trotts @ 2004-03-03 19:53 UTC (permalink / raw)
  To: caml-list

On Tue, Mar 02, 2004 at 10:25:39PM -0800, Kenneth Knowles wrote:

> 
> > There is no Debian package for this,
> > though it looks like a useful program.  
> 
> >From the DARCS webpage:
> ----------------------
> 
> Debian users
> 
> If you use debian, you can install darcs via apt. For woody, add the following
> lines to your sources.list: 
...

Thanks!

> > I wonder if Darcs could be modified to explicitly keep track of changes
> > to the ASTs of OCaml source files...
> 
> Now this sounds interesting!  Someone very ambitious could invent a source
> control item with plugins for parsing different languages, and diffing the
> trees.

It could be done with a bit less ambition:
  
  let ast = parse_with_camlp4 infile in
  let ast_diffs = edit_ast_with_gui ast in
  output_diffs outfile ast_diffs

That way the user has explicit control over the differences, as with the
Token Replace Patch idea at 

  http://abridgegame.org/darcs/manual/node7.html#token_replace

> > Could it output an OCaml script instead of a makefile?  It would
> > probably be easier to read, debug, and modify.
> 
> I phrased this badly.  What you want, is what it does, I think.  I should have
> said that it "outputs a configure script, which when run outputs a makefile and
> config.ml"

That's good but I would prefer to use OCaml and avoid makefiles
altogether, similar to how Python's distutils just uses Python.  Then we
could have more sophisticated build rules with fixed points etc. (as
John Max Skaller described in a post a while back.)

> I will quickly explain all of what it does.
> 
> (1)	You write configure.ml, somewhat analogous to configure.ac
> (2)	You run ocamlconf, it creates a configure script
> ----
> (3) The end user/you run the configure script - it outputs a makefile and/or
>     configuration summary ocaml file.
> (4) make && make install
> 
> Every stage is easy to debug - your configure.ml script is a simple ocaml
> script.  The configure script (actually configure.mlc, for technical reasons,
> and the configure script is a shell wrapper around `ocaml configure.mlc`) is
> also plain text ocaml, but with additional code copied into it.  And even the
> makefile is about as simple as possible for your project, so hopefully bugs in
> ocamlconf will easily be discovered.

-- 
Issac Trotts
http://redwood.ucdavis.edu/~issac

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03  6:25   ` Kenneth Knowles
  2004-03-03 19:53     ` Issac Trotts
@ 2004-03-03 19:56     ` David MENTRE
  2004-03-03 20:29       ` Issac Trotts
  1 sibling, 1 reply; 9+ messages in thread
From: David MENTRE @ 2004-03-03 19:56 UTC (permalink / raw)
  To: Kenneth Knowles; +Cc: ijtrotts, caml-list

Hello Kenneth,

Kenneth Knowles <kknowles@uclink.berkeley.edu> writes:

> The configure script (actually configure.mlc, for technical reasons,
> and the configure script is a shell wrapper around `ocaml configure.mlc`) is
> also plain text ocaml, but with additional code copied into it.

So the produced configure script is an OCaml program that needs the
ocaml environment to run? I share all the objections against autoconf,
but at least it produces a simple sh script that can run on any (unix)
system. The role of a configure script is also to find the ocaml
compiler or warn that it is a requirement. That's said, I admit that if
somebody intends to compile an OCaml program, he probably have ocaml on
his machine. But that's still introduce a dependency *before* running
the configure script of which role is to find dependencies.

My 2 cents,
Yours,
d.
-- 
 David Mentré <dmentre@linux-france.org>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03 19:56     ` David MENTRE
@ 2004-03-03 20:29       ` Issac Trotts
  2004-03-03 22:36         ` Kenneth Knowles
  0 siblings, 1 reply; 9+ messages in thread
From: Issac Trotts @ 2004-03-03 20:29 UTC (permalink / raw)
  To: caml-list

On Wed, Mar 03, 2004 at 08:56:27PM +0100, David MENTRE wrote:
> Hello Kenneth,
> 
> Kenneth Knowles <kknowles@uclink.berkeley.edu> writes:
> 
> > The configure script (actually configure.mlc, for technical reasons,
> > and the configure script is a shell wrapper around `ocaml configure.mlc`) is
> > also plain text ocaml, but with additional code copied into it.
> 
> So the produced configure script is an OCaml program that needs the
> ocaml environment to run? I share all the objections against autoconf,
> but at least it produces a simple sh script that can run on any (unix)
> system. The role of a configure script is also to find the ocaml
> compiler or warn that it is a requirement. That's said, I admit that if
> somebody intends to compile an OCaml program, he probably have ocaml on
> his machine. But that's still introduce a dependency *before* running
> the configure script of which role is to find dependencies.

We could solve this problem by bundling a simple sh script to check
whether OCaml is installed, and maybe get it if not.

-- 
Issac Trotts
http://redwood.ucdavis.edu/~issac

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03 20:29       ` Issac Trotts
@ 2004-03-03 22:36         ` Kenneth Knowles
  0 siblings, 0 replies; 9+ messages in thread
From: Kenneth Knowles @ 2004-03-03 22:36 UTC (permalink / raw)
  To: caml-list


> > > The configure script (actually configure.mlc, for technical reasons)
> > 
> > So the produced configure script is an OCaml program that needs the
> > ocaml environment to run?
> 
> We could solve this problem by bundling a simple sh script to check
> whether OCaml is installed, and maybe get it if not.

It already does this, sorry about being so terrible about the details!  (I kind
of thought of that as an implementation detail, but now I see it was important
to tell people).  'configure' is a sh script, and 'configure.mlc' is the ml
file.  I used a funny suffix so it wouldn't conflict with configure.ml -
probably I should just invent a name like configure_out.ml

The sh script is a little bare, because it has only been used on 3 or 4 systems,
and it doesn't really have to do much.

> Hi Kenneth,
>    Any chance that you could make a more standard distribution of ocamlconf, 
> like say a gzipped tarball that the darcs deprived can use?
> -- Brian                                

Sure; I didn't do this because I didn't want to deceive anyone about that they
were getting :-)  Now that I see the level of interest, I'll package it up into
a release.

Meanwhile, there is a tarball of the ocamlconf directory:
http://kefka.frap.net:8080/~kenn/repos/ocamlconf.tar.gz

Kenn

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03 19:53     ` Issac Trotts
@ 2004-03-03 23:06       ` Kenneth Knowles
  0 siblings, 0 replies; 9+ messages in thread
From: Kenneth Knowles @ 2004-03-03 23:06 UTC (permalink / raw)
  To: caml-list

> That's good but I would prefer to use OCaml and avoid makefiles
> altogether, similar to how Python's distutils just uses Python.  Then we
> could have more sophisticated build rules with fixed points etc. (as
> John Max Skaller described in a post a while back.)

Ok, well I totally agree with this, and if anyone has any fixpoint-based
building code, a grand build system could really be in the works... 

Does ocaml ever really need fixpoints (except for the compiler itself)?  If this
is to be ocaml-centric (like I assume python's distutils are) then it seems like
digests of files like Cook uses would be sufficient...  TeX is the only thing I
know that needs fixpoint computations.

Besides that I see a lot of value in the semantic separation of configuration -
determine what requirements and options a site has - and building.  I even like
the user interface of 'configure && make && make install'

If the make and the make install steps were written in ocaml, great.  In
particular I think almost all of 'make install' should be handled by findlib, so
it really just needs (1) improvements to ocamlconf (2) build tool (3) probably
some more flexibility to findlib.

Kenn

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC
  2004-03-03  1:47 [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC Kenneth Knowles
  2004-03-03  5:16 ` Issac Trotts
@ 2004-03-11 11:09 ` Markus Mottl
  1 sibling, 0 replies; 9+ messages in thread
From: Markus Mottl @ 2004-03-11 11:09 UTC (permalink / raw)
  To: Kenneth Knowles; +Cc: caml-list

On Tue, 02 Mar 2004, Kenneth Knowles wrote:
> *	OcamlMakefile is awkward with multiple targets (such as suites
>	of utilities) and I'd rather write (or depend on) a simple ocaml
>	script than a complex Makefile

I have taken this criticism as motivation to make OCamlMakefile more
useful with subprojects (i.e. multiple targets).  The newest release is
now available and should make this task much simpler.

Here is an example from the distribution on how to specify two
subprojects:

---------------------------------------------------------------------------
# Set OCamlMakefile to use
export OCAMLMAKEFILE = ../OCamlMakefile

# Export some common variable settings
export THREADS = yes

# Define project "ex1"
export PROJ_ex1 = \
  SOURCES=ex1.ml \
  RESULT=ex1

# Define project "ex2"
export PROJ_ex2 = \
  SOURCES=ex2.ml \
  RESULT=ex2

# If the environment does not define subprojects to handle,
# then use "ex1 ex2" as default
ifndef SUBPRJS
  export SUBPRJS = ex1 ex2
endif

# Default target to use
all:    bc

# Catch-all target will be applied to all subprojects automatically
%:
        @make -f $(OCAMLMAKEFILE) subprjs SUBTARGET=$@
---------------------------------------------------------------------------

You can use the usual shortcuts like "make nc" (= build native code),
etc., for compiling several subprojects at once.  Setting/exporting
variable "SUBPRJS" in the shell environment or passing it to "make"
on the command line allows you to refer to any subset of your projects
that should be affected by the next command.  I think this is as easy
as things can get - but feel free to send me suggestions for improvement!

Regards,
Markus

-- 
Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2004-03-11 11:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03  1:47 [Caml-list] [ANNOUNCE] Development versions: ocamlconf, ASPCC Kenneth Knowles
2004-03-03  5:16 ` Issac Trotts
2004-03-03  6:25   ` Kenneth Knowles
2004-03-03 19:53     ` Issac Trotts
2004-03-03 23:06       ` Kenneth Knowles
2004-03-03 19:56     ` David MENTRE
2004-03-03 20:29       ` Issac Trotts
2004-03-03 22:36         ` Kenneth Knowles
2004-03-11 11:09 ` Markus Mottl

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