Previous week   Up   Next week
Hello,

Here is the latest Caml Weekly News, week 06 to 13 May, 2003.

1) ODLL Release
2) XmlLight 2 Release
3) Paper on zippers
4) Structural vs physical equality
5) Ocaml-MySQL 1.0.0

======================================================================
1) ODLL Release
----------------------------------------------------------------------
Nicolas Cannasse announced:

I'm please to announce the first release of ODLL.

If you're having a boss asking you to write C librairies but if you prefer
to write them in OCaml, this tool is for you ! ODLL is creating a Win32 DLL
from an OCaml library, and automatically generating the C stubs needed to
interface the OCaml code and the C code and the .H interface. Simply run
ODLL with you CMA/CMXA and one or several CMI interfaces and ODLL
will do the job for you.

The distribution is available at http://tech.motion-twin.com
Comments/suggestions are welcome,

Thanks to Lexifi - member of the Ocaml consortium - for their support in
this project.

======================================================================
2) XmlLight 2 Release
----------------------------------------------------------------------
Nicolas Cannasse announced:

I'm please to announce the release of the version 2 of Xml-Light :
Xml Light is a small parser/printer for Xml documents, entirely written in
OCaml. It supports a subset of the Xml specification, which should be enough
for most of the usages, including DTD proving and PCDATA nodes. You can
download the distribution or watch the Ocamldoc HTML documentation on the
web page : http://tech.motion-twin.com/xmllight .

Any comments/remarks are of course more than welcome.

======================================================================
3) Paper on zippers
----------------------------------------------------------------------
The following thread of messages led to Gérard Huet saying:

>>>I've a simple tree structure and I want to walk it. Since in such a
>>>simple tree structure I can go AFAIK only sidewards or
>>>upwards/downwards, and I need to do both, I guess what can be an
>>>efficent way to do so.
>>
>>That sounds like a job for Gérard Huet's "zippers":
>>
>>G. Huet. The Zipper. Journal of Functional Programming, 7 (5), Sept
>>1997, pp. 549--554.
>>
>>Apparently, the paper isn't freely available on-line, but see
>>
>>http://www.informatik.uni-bonn.de/~ralf/publications/TheWeb.ps.gz
>>
>>for a quick overview of the zipper, and more advanced stuff.
>>
>
>Thank you very much. I'm now using also a posting about zippers on 
>this list
>http://caml.inria.fr/archives/200304/msg00202.html and I was suggested 
>to
>take a look at 
>http://pauillac.inria.fr/~remy/cours/appsem/ocaml-ml.html
>

Hello
My original zipper paper is not on-line, but my latest thoughts on the
subject are given in
"Linear Contexts and the Sharing Functor: Techniques for Symbolic
Computation", available from
http://pauillac.inria.fr/~huet/PUBLIC/DB.pdf

======================================================================
4) Structural vs physical equality
----------------------------------------------------------------------
Following questions on equality, Xavier Leroy said:

> > Which means that lst = [] does not imply lst == [].
> > 
> > In other words, one should use:
> > 
> >     if lst = [] then empty-code else full-code
> > 
> > or pattern matching, as you said.
> 
> Is it really not defined by Ocaml?  Ocaml implements the empty list as
> the integer value zero.  Although (==) won't tell you if two cons-cells
> have the same contents, it will tell you if they are the same.

It happens to work in this case, but relies on features of the
implementation.  It's better to use "==" only between mutable data
structures, where it has a well-defined meaning (two mutable
structures are == iff an in-place modification to one of them affects
the other one as well), and "=" otherwise.

> So is there any implementation of a caml language where [] == [] isn't
> always true, for any way that [] is generated?

Both Caml Light and OCaml ensure [] == [], but again it's better not
to rely on this fact.

> The (=) has more overhead

It doesn't: the OCaml compiler is clever enough to compile "lst = []"
as a direct comparison against the integer value zero.

======================================================================
5) Ocaml-MySQL 1.0.0
----------------------------------------------------------------------
Shawn Wagner announced and asked:

Bindings for accessing MySQL databases from ocaml programs.

Since nobody reported any bugs with the version (0.9.1) I released last
month, I'm bumping the version to 1.0.0. No other changes.

Available at http://raevnos.pennmush.org/code/ocaml.html


On a related note, have the people working on database server independant
DBI-type interfaces for ocaml made any significant progress? I'm thinking
about including higher-level query generating functions in the next major
release (Something like Query.select connection ~columns:["name"; "address"]
~from:(`Table "customers") ~where:"last_ordered > some-timestamp" ()), but
won't bother if there's other viable alternatives. I'd rather take the time
to make sure my code hooks into them.

======================================================================
Old cwn
----------------------------------------------------------------------

If you happen to miss a cwn, you can send me a message
(alan.schmitt@inria.fr) and I'll mail it to you, or go take a look at
the archive (http://pauillac.inria.fr/~aschmitt/cwn/). If you also wish
to receive it every week by mail, just tell me so.

======================================================================

Alan Schmitt