Here is the latest Caml Weekly News, for the week of March 13 to 20, 2007.
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/21111d096cc38ea2/a4b6803d52ed2a20#a4b6803d52ed2a20Ian asked, Gabriel Kerneis and Maxence Guesdon answered:
> > I'm looking for a guidebook or just some rules of thumb on how to organize > > my OCaml code. > > If you can read french : > http://caml.inria.fr/pub/old_caml_site/FAQ/pgl-fra.html This page and its english version were ported to the new site some months ago: http://caml.inria.fr/resources/doc/guides/guidelines.fr.html http://caml.inria.fr/resources/doc/guides/guidelines.en.html
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/13b04f870253f02d/7f45ca175b7eed9b#7f45ca175b7eed9bYoriyuki Yamagata announced:
Archive: http://groups.google.com/group/ocaml-developer/browse_frm/thread/532cfd6cc675e98bHugo Ferreira asked and Francisco Valverde answered:
> I have the need to use some logical programming functionality within my > application. I would like to embed this into my Ocaml code as a domain > specific language. I am contemplating the use of Camlp4 for this. M I recall reading an impressive presentation on how to do this (at least partially) in OCaml. Hold on... Yes, the wikipedia has the missing link! ;) http://www.venge.net/graydon/talks/mkc/html/mgp00002.html
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/f4460a94f244e6ed/9ed1ec7694e27cf6#9ed1ec7694e27cf6Aleksey Nogin announced:
We are proud to announce the latest release of the OMake Build System - OMake version 0.9.8.1. OMake is a build system designed for scalability and portability. It uses a syntax similar to make utilities you may have used, but it features many additional enhancements, including the following. - Support for projects spanning several directories or directory hierarchies. - Fast, reliable, automated, scriptable dependency analysis using MD5 digests, with full support for incremental builds. - Fully scriptable, includes a library that providing support for standard tasks in C, C++, OCaml, and LaTeX projects, or a mixture thereof. Often, a configuration file is as simple as a single line .DEFAULT: $(OCamlProgram prog, foo bar baz) which states that the program "prog" is built from the files foo.ml, bar.ml, and baz.ml. This one line will also invoke the default standard library scripts for discovering implicit dependencies in OCaml files. - Full native support for rules that build several files at once. - Portability: omake provides a uniform interface on Linux/Unix (including 64-bit architectures), Win32, Cygwin, Mac OS X, and other platforms that are supported by OCaml. - Built-in functions that provide the most common features of programs like grep, sed, find, and awk. These are especially useful on Win32. - Active filesystem monitoring, where the build automatically restarts whenever you modify a source file. This can be very useful during the edit/compile cycle. - A built-in command-interpreter osh that can be used interactively. OMake preserves the style of syntax and rule definitions used in Makefiles, making it easy to port your project to OMake. There is no need to code in Perl (cons), or Python (scons). However, there are a few things to keep in mind: 1. Indentation is significant, but tabs are not required. 2. The OMake language is functional: functions are first-class and there are no side-effects apart from I/O. 3. Scoping is dynamic. OMake is licensed under a mixture of the GNU GPL license (OMake engine itself) and the MIT-like license (default configuration files). Additional information and extensive documentation can be found on OMake Home Page at http://omake.metaprl.org/ OMake version 0.9.8.1 is a minor feature enhancements and bugfixes release. The changes in this version include: - Added a large number of new built-in and standard library functions - Extented the autocomfiguration section of the standard library - A number of improvements in the interactive osh shell. - A number of improvements in the library of standard build recipes - Documentation improvements. - A number of other improvements and bugfixes. For a more verbose change log, please visit http://omake.metaprl.org/changelog.html#0.9.8.1 . Source and binary packages of OMake 0.9.8.1 may be downloaded from http://omake.metaprl.org/download.html . In addition, OMake may be obtained via the GODI packaging system. To try it out, run the command "omake --install" in a project directory, and modify the generated OMakefile. OMake 0.9.8.1 is still an alpha release. While we have made an effort to ensure that it is bug-free, it is possible some functions may not behave as you would expect. Please report any comments and/or bugs to the mailing list firstname.lastname@example.org and/or at http://bugzilla.metaprl.org/Nathaniel Gray added:
FYI, the OS X PPC package is now available.
Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/02477e8de62fb685/49c2373ee8189931#49c2373ee8189931Christophe Raffalli asked:
The programs listed in the subject of this mail are parser generators for OCaml ... There may be others, and there is also the possibility to write parsers by hand using stream pattern matching, parser combinators, etc ... (the later technics are not covered here) It would be nice to have a small comparison table to help people making a decision ? Being not neutral (dypgen was developped by a student at ENS lyon under my direction) I think I should not do it myself ... But I gave it a try. Here is a first draft (This table is not correct yet and should not be used to make a decision ;-) http://www.lama.univ-savoie.fr/~raffalli/ocaml-parsing.html The html produced by ooffice is poor and the calculator example is not well presented due to an ooffice bug (I think). Questions - Can you help me complete the table (missing lines, columns, inaccurate or missing information) ? - Can you provide the best possible calculator example for the other parser as a text file ? - Can you provide a really difficult but short grammar to make a better comparison ? - Other Idea welcome - If someone neutral wants to volonteer to host this comparison table, I will be very please to send him the source of the table.Aleksey Nogin answered:
I am not an expert in camlp4, but I probably know enough to be able to fill in a few blanks in the last column of your table. My answers are based on "old" 3.09 camlp4 and might be different for the new 3.10 one. Handled grammar: LL(1) Reentrant: Yes, but with caveats(*1) Extensible (an action can change the grammar): Yes(*2) Parametrized non terminal: No (???, *3) Splitting the definition of a non terminal: Yes Grammars parametrized by Ocaml modules: ??? (Yes? - *4) Partial action: No Ambiguous grammars: Yes (???, *5) Exception to reject a rule: No (???) Priority: Using levels (= a partial order as a relation) + associativity direction Debugging grammars: hard --- (*1) In 3.09, reentrant parsing works, except the error messages might end up pointing to the wrong place in the source stream (supposed to be fixed in 3.10, AFAIK). However, there is no good way of passing a state to the grammar actions. As a result, one often has to resort to using a global ref to hold the state, which, obviously, kills the ability to be reentrant. (*2) For example, see the pa_macro where the action for the DEFINE and UNDEF expressions change the grammar accordingly. (*3) As far as I understand, only tokens can be parameterized, although that might have changed in 3.10. (*4) I am not sure which capability exactly is meant here. In Camlp4, the grammar definitions/extensions can be done inside a body of a functor. The actual grammar is created when the functor is applied. (*5) Not sure what is meant here. In camlp4, unfortunately, there is no way to test the grammar for ambiguities - it accepts an ambiguous grammar without any warnings.
Archive: http://groups.google.com/group/ocaml-developer/browse_frm/thread/e4882cb3243d3114Gordon asked and Daniel answered:
> Does anyone have any moderate level examples of parsing XML using a > SAX style parser to build data structures? I'm trying to use Expat to > do some XML parsing and I just seem to be having a mental block as to > how to build up a data structure in this style. The examples on this page  may help. They show how to build the document tree using a SAX style parser. Daniel  http://xmlm.googlecode.com/svn/trunk/distrib/xmlm-0.9.0/doc/Xmlm.html#ex
Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).
If you know of a better way, please let me know.
If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.
If you also wish to receive it every week by mail, you may subscribe online.