Previous week Up Next week

Hello

Here is the latest Caml Weekly News, for the week of June 02 to 09, 2009.

  1. OCaml/Sqlite ORM layer (preview 0.2)
  2. Probabilistic programming in OCaml
  3. OCaml 3.11.1+rc1
  4. ML 2009 Call for Demos
  5. Which types for representing HTML documents ?
  6. Other Caml News

OCaml/Sqlite ORM layer (preview 0.2)

Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/80eefd151c3c40db637f72b25fcac36a.en.html

Anil Madhavapeddy announced:
I've been using OCaml in a few server projects which need a light- 
weight database, and so I wrote a library to map OCaml objects  
directly to a SQLite3 backend database.

Like other ORM systems, you define a schema based on sets of named  
fields.  The Sql_orm library then generates an OCaml module and  
interface with static accessor methods which take care of all the  
tedious SQL interactions and provide you with a nice high-level,  
statically type-safe access method.

It's still early days but the library is very functional and stable.   
I've put up docs and instructions at:
http://wiki.github.com/avsm/ocaml-orm-sqlite

It's currently written as a module which outputs OCaml directly, and  
once I'm happy with the feature-set, I intend to port it to use camlp4  
so that schemas can be declared directly without the need to  
regenerate a separate ML file.

You can view an example schema at: http://tinyurl.com/sqlorm-example
- schema.ml declares the fields
- test.ml uses it
- my_db.* are the generated files.
- the tests/ directory has more advanced usage, such as foreign keys  
and so on.
      

Probabilistic programming in OCaml

Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/fbd251353f71c81388f0a07febb5455e.en.html

Continuing the thread from last week, Eliot Handelman asked and Oleg replied:
> This looks really interesting,. but can it be compiled with 3.10.1?
> First bash at compiling the delimcc library failed.

Yes, the library can be used with 3.10.1 and even 3.09. I think I know
what problem you have encountered. Ideally, to compile delimcc you
need the configured OCaml sources, because delimcc needs a few header
files that are not normally installed. Since one could install OCaml
from a binary distribution, the sources are not necessarily
available. Therefore, delimcc includes the needed header files as part
of its distribution, for the most common platform: ia32 and
Linux/BSD. Alas, these files differ slightly among OCaml versions
(e.g., because of renaming). Therefore, delimcc distribution includes
two sets of files, in the directories ocaml-byterun-3.09 and
ocaml-byterun-3.10. With OCaml 3.10.1, one has to use
ocaml-byterun-3.09 files rather than ocaml-byterun-3.10. Sorry, this
is indeed confusing.

Thus, you may want to edit the Makefile in delimcc, comment out the
line
	OCAMLINCLUDES=./ocaml-byterun-3.10
and uncomment the line above that contains 3.09. I think it would
build delimcc library (please `make testd0' to make sure).
      

OCaml 3.11.1+rc1

Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/77ab6ab4f73547157f7100339ab19302.en.html

Damien Doligez announced:
We fixed a few bugs from OCaml 3.11.1+rc0, and prepared a new release  
candidate.
The main changes from rc0 are the following.

- PR#4796: ocamlyacc: missing NUL termination of string
- PR#4798: compilation of ocamldoc.opt fails under windows
- PR#4804: bug in Big_int.int64_of_big_int on 32-bit platforms.
- PR#4805: improving compatibility with the clang C compiler
- PR#4809: issue with Unix.create_process under Win32

The changes from 3.11.0 are listed at the end of this mail.


If you haven't tested rc0, or if you had a problem with one of the above
bugs, please test rc1 now and send me some feedback.  This release
candidate is available in source code at
ftp://ftp.inria.fr/INRIA/cristal/ocaml/ocaml-3.11/ocaml-3.11.1+rc1.tar.gz

We seem to have a small problem remaining in build/install.sh.  It  
will be
fixed for the release.

Happy hacking,

-- Damien for the OCaml team


Objective Caml 3.11.1:
----------------------

Bug fixes:
- PR#4095: ocamldebug: strange behaviour of control-C
- PR#4403: ocamldebug: improved handling of packed modules
- PR#4650: Str.regexp_case_fold mis-handling complemented character  
sets [^a]
- PR#4660: Scanf.format_from_string: handling of double quote
- PR#4666: Unix.exec* failure in multithread programs under MacOS X  
and FreeBSD
- PR#4667: debugger out of sync with dynlink changes
- PR#4678: random "out of memory" error with systhreads
- PR#4690: issue with dynamic loading under MacOS 10.5
- PR#4692: wrong error message with options -i and -pack passed to  
ocamlc
- PR#4699: in otherlibs/dbm, fixed construction of dlldbm.so.
- PR#4704: error in caml_modify_generational_global_root()
- PR#4708: (ocamldoc) improved printing of infix identifiers such as  
"lor".
- PR#4722: typo in configure script
- PR#4729: documented the fact that PF_INET6 is not available on all  
platforms
- PR#4730: incorrect typing involving abbreviation "type 'a t = 'a"
- PR#4731: incorrect quoting of arguments passed to the assembler on  
x86-64
- PR#4735: Unix.LargeFile.fstat cannot report size over 32bits on Win32
- PR#4740: guard against possible processor error in
            {Int32,Int64,Nativeint}.{div,rem}
- PR#4745: type inference wrongly produced non-generalizable type  
variables.
- PR#4749: better pipe size for win32unix
- PR#4756: printf: no error reported for wrong format '%_s'
- PR#4758: scanf: handling of \<newline> by format '%S'
- PR#4766: incorrect simplification of some type abbreviations.
- PR#4768: printf: %F does not respect width and precision  
specifications
- PR#4769: Format.bprintf fails to flush
- PR#4775: fatal error Ctype.Unify during module type-checking  
(temporary fix)
- PR#4776: bad interaction between exceptions and classes
- PR#4780: labltk build problem under Windows.
- PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix  
error.
- PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms.
- PR#4796: ocamlyacc: missing NUL termination of string
- PR#4804: bug in Big_int.int64_of_big_int on 32-bit platforms.
- PR#4805: improving compatibility with the clang C compiler
- PR#4809: issue with Unix.create_process under Win32
- Module Parsing: improved computation of locations when an ocamlyacc  
rule
                   starts with an empty nonterminal
- Type-checker: fixed wrong variance computation for private types
- x86-32 code generator, MSVC port: wrong "fld" instruction generated.
- ocamlbuild: incorrectly using the compile-time value of $OCAMLLIB
- Makefile problem when configured with -no-shared-libs
- ocamldoc: use dynamic loading in native code

Other changes:
- Improved wording of various error messages
   (contributed by Jonathan Davies, Citrix).
- Support for 64-bit mode in Solaris/x86 (PR#4670).
      
Richard Jones then said:
I built this for Fedora:

  http://koji.fedoraproject.org/koji/taskinfo?taskID=1392144

Not really tested it very much beyond running a few scripts in the
toplevel.
      

ML 2009 Call for Demos

Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/e13782ebab438145bbdba2c76ddf93fa.en.html

Andreas Rossberg announced:
                           CALL FOR DEMOS

                    2009 ACM SIGPLAN Workshop on ML

               To be held in conjunction with ICFP 2009
                      on Sunday, August 30, 2009
                      in Edinburgh, Scotland, UK

               http://www.mpi-sws.org/~rossberg/ml2009/


Have you written a fancy tool or library that may ease the life of
fellow ML programmers? Have you developed interesting software using
your favorite dialect of ML? Or have been producing some cool ML code
lately that you just want to show off in action?

Now is your chance to demonstrate it to the world. This year's ML
Workshop will feature a session for presenting running code written
in ML, or written for ML. We seek 10-15 minute live demos or tutorials
related to ML technology that show new developments, interesting
prototypes, or work in progress.

The 2009 Workshop on ML will be held in conjunction with the 14th ACM
SIGPLAN International Conference on Functional Programming (ICFP 2009)
in Edinburgh, Scotland, UK.


IMPORTANT DATES

Demo Submission: Sunday, June 28, 2009
Notification:    Friday, July 10, 2009
Workshop:        Sunday, August 30, 2009


SUBMISSION GUIDELINES

Please submit an abstract, about half a page long, describing the demo
and its technical content. Be sure to include the demo's title, authors,
collaborators, references and acknowledgements. If you have a project
website we encourage you to also provide a link that we can put up on
the ML Workshop home page once your demo is accepted.

Your demonstration should take 10-15 minutes. The exact length per demo
will be decided based on the number of accepted submissions. Please notice
that you will have to bring all hardware and software required for your
demo yourself -- all the workshop organizers can provide is a projector.

Please send submissions (in PDF format) with your complete contact
information via email to ml2009@easychair.org by June 28, 2009. Please
feel free to also contact this address if you have further questions.


PROGRAM CHAIR

Andreas Rossberg         (Max Planck Institute for Software Systems)

PROGRAM COMMITTEE

Umut Acar                (Toyota Technological Institute at Chicago)
Damien Doligez           (INRIA Paris-Rocquencourt)
Neal Glew                (Intel)
Andrew Gordon            (Microsoft Research Cambridge)
Patricia Johann          (University of Strathclyde)
Oleg Kiselyov            (FNMOC)
Neelakantan Krishnaswami (Carnegie Mellon University)
David MacQueen           (University of Chicago)
Yasuhiko Minamide        (University of Tsukuba)
Norman Ramsey            (Tufts University)

STEERING COMMITTEE

See the ML Workshop series home page at:
http://www.tti-c.org/blume/ml-workshop/
      

Which types for representing HTML documents ?

Archive: http://caml.inria.fr/pub/ml-archives/caml-list/2009/06/7e6781f7e8c895ace3ca88af5f4c1b16.en.html

Sébastien Hinderer asked and Gabriel Kerneis replied:
> According to you, how could an HTML document best be represented in
> OCaml ?

http://ocsigen.org/docu/1.2.0/XHTML.M.html

The whole website is worth reading if you're interested in web
programing using Ocaml.
      
Richard Jones also replied:
CDuce is worth considering:

http://www.cduce.org/examples.html
      
Martin Jambon also replied:
Ocamlnet's Nethtml works fine for parsing:

type document =
    Element of
      (string * (string * string) list *
       Nethtml.document list)
  | Data of string


If your goal is to interpret arbitrary web pages, you have to allow all kinds
of standard or non-standard elements and attributes anywhere in the document.

If you are creating HTML documents, beware that you can't embed Flash objects
using standard HTML.  I'm not even speaking of javascript happily manipulating
the DOM tree with little restrictions.


Personally I use text templates and validate web pages once they are in my
browser (using the shortcut to validator.w3.org that opera provides).  For
javascript-generated nodes, I just check that it works in various browsers
(the firefox "View source chart" extension is useful for debugging the DOM tree).


I do not suffer at all from the absence of static type-checking of the HTML
tree.  I imagine that the reasons for this are:

* HTML is the final product and is trivial to debug (no need to printf
everything since everything is already printed...)

* There are no complicated conditionals that would leave certain parts of the
code untested for a long time.

* Mainstream web browsers are very tolerant.  Small accidental deviations from
the strict W3C standards usually have no visible effect.
      

Other Caml News

From the ocamlcore planet blog:
Thanks to Alp Mestan, we now include in the Caml Weekly News the links to the
recent posts from the ocamlcore planet blog at http://planet.ocamlcore.org/.

DJ mix using liquidsoap:
  http://blog.rastageeks.org/spip.php?article35

ocsforge:
  http://forge.ocamlcore.org/projects/ocsforge/

Mise en boîte:
  http://misterpingouin.blogspot.com/2009/06/mise-en-boite.html

Euler's Power Riffs:
  http://alaska-kamtchatka.blogspot.com/2009/06/eulers-power-riffs.html

Immutability Redux:
  http://alaska-kamtchatka.blogspot.com/2009/06/immutability-redux.html

Jim Henson Co.:
  http://www.mega-nerd.com/erikd/Blog/CodeHacking/libsndfile/henson.html

Archimedes:
  http://forge.ocamlcore.org/projects/archimedes/

Another Quick Shot of the Desktop Product:
  http://coherentpdf.com/blog/?p=36

ocaml-orm-sqlite 0.2:
  http://caml.inria.fr/cgi-bin/hump.cgi?contrib=701

The Battle For Your Address Book:
  http://feedproxy.google.com/~r/Skydeck/~3/q61PxbixZ2I/the-battle-for-your-address-book
			

Old cwn

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.


Alan Schmitt