Previous week Up Next week


Here is the latest Caml Weekly News, for the week of January 22 to 29, 2008.

  1. ledit 2.00 with .leditrc file
  2. PostDoc offer on JoCaml
  3. ocamlnet mini tutorial: netclient and cookie based authentication
  4. Palindromic Quine
  5. POPL 2009 Call for Workshop and Co-located Event Proposals
  6. Ocaml Meeting's talks available

ledit 2.00 with .leditrc file


Daniel de Rauglaudre announced:
I am happy to announce a new release of ledit : 2.00.

Ledit is a line editor allowing to run interactive commands (e.g. the
OCaml toplevel) with the ability to move the cursor, delete parts, see
balanced parentheses, move inside the history, things like that, like
in emacs or in the shell.

Main change:
 It is now possible to have one's own keys bindings in the file ".leditrc"
 of one's home directory (or defined by the environment variable LEDITRC).
 See manual page.
   Note: this file can be modified while ledit is running, the changes are
 immediately taken into account.

Download the sources at:

PostDoc offer on JoCaml


Luc Maranget announced:
Our team (Moscova, Inria Rocquencourt, France) proposes a
post-doctoral fellow position.

The work we propose can be summarized as
	 Illustrate, develop and extend JoCaml

A web page on the jocaml site
gives all details on the offer.

Some points of importance are :

  Application deadline Feb. 29, 2008.

  You (will) hold your Phd for less than one year at the recruitment date.

  You have strong background in functionnal programming, and
  good knowledge in process calculi, concurrent programming,
  network programming, or compiler construction.

ocamlnet mini tutorial: netclient and cookie based authentication


Hendrik Tews said:
for ocamlnet novices I document here what you need to access web
sites that use cookies for authentication (eg, wikis or mailman).
With this you can let ocaml perform your mailing-list
administrator tasks or write a wiki bot.

Cookie authentication works as follows: When you first visit the
site you have to authenticate with username and password that are
usually sent (in cleartext) in a post request to the server. The
server responses with a cookie that will be used for
authentication in all following requests. 

Because you have to retrieve and set cookies in the headers you
cannot use the Http_client.Convenience module. You really have to
dive into ocamlnet.

Here comes the solution:

Netstring extension:

- You need get_set_cookie, which will retrieve cookies from a
 response header but which is not in ocamlnets netstring library
 currently. Download from [1] or with two additional helper
 functions from [2].


- Create a pipeline with "new Http_client.pipeline", it will
 process all http requests. (Don't ask me about timeouts and
 retries, the defaults work fine for me.)

Get going (download some page without authentication):

- Create a get call "new Http_client.get url"

- Process the call: Add it to the pipeline (method #add) and run
 the pipeline (#run). By this the call will be changed and
 contain the response. 

- Check the response status (#response_status), which should
 usually be `OK and get the page (#response_body#value).

- In case of error convert the status into something readable
 with Nethttp.string_of_http_status or consult the response
 status message (#response_status_text).


- Create post call with 
 "new url parameters", the parameters are a
 string * string list, eq 
   [("wpName", "mywikiname");
    ("wpPassword", "mywikipasswd");
    ("wpLoginattempt", "Log in")]
 for a MediaWiki.

 [In order to get the parameters save the login page, change the
 method of the right from into "GET", load the page into a
 browser, press the login button and parse the new URL you get.]

- Process the call.

- Check the status (#response_status): For MediaWiki it should be
 `Found, for mailman and others `Ok (don't ask me why).

- Retrieve the response header (#response_header) and extract the
 cookies with get_set_cookies from [2].

Make an authenticated request:

- Create your call "new get url" for getting a page or 
 "new post url" for performing an action.

- Access the request header (#request_header `Base) and add your
 cookies there (set_cookies from [2]). This is all done via
 side-effects, no need to write the modified header back into
 the call.

- Process the call and get the response.


- with findlib and -package netclient -linkpkg:

 ocamlfind {ocamlc,ocamlopt} -package netclient -linkpkg your files ...


- Praise Gerd Stolpmann for ocamlnet and findlib.

That's it. For an example go to [3], which contains a MediaWiki
bot that updates structural information in the Mozilla wiki [4].
The needed utility functions are in wiki_http: wiki_login to
login, download to download a web page, get_page to get a wiki page
and write_wiki_page to write one.






Palindromic Quine


Keisuke Nakano announced:
A 'Palindromic Quine' code is now wanted by a shortest-code contest at:

The code should be a Quine, which prints its own code without reading
its source file. Additionally, the code should be palindromic, which
reads the same forward as it does backward. Shorter code is better.
Lots of programming languages are available including OCaml, of course.

Please submit your palindromic Quine to the above contest if you find it.
The deadline is Thursday, 7 February 2008, 16:46:39, GMT.
All submitted programs will be revealed after the deadline.
At present the shortest code in OCaml has 205 bytes.

POPL 2009 Call for Workshop and Co-located Event Proposals


Yitzhak Mandelbaum:

		POPL 2009, the 36th ACM SIGPLAN-SIGACT
	   Symposium on Principles of Programming Languages

			  21-23 January 2009
                         Savannah, Georgia


The 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming
Languages (POPL 2009) will be held in Savannah, Georgia from
January 21 to January 23. POPL provides a forum for the discussion of
fundamental principles and important innovations in the design,
definition, analysis, transformation, implementation and verification
of programming languages, programming systems, and programming
abstractions. Both experimental and theoretical papers on principles
and innovations are welcome, ranging from formal frameworks to reports
on practical experiences.

Proposals are invited for events to be co-located with POPL 2009,
including tutorials, workshops and conferences. Co-located events can
either be sponsored directly by SIGPLAN or supported through in-cooperation

** Submission details **

Deadline for submission:     Monday, March 10th, 2008
Notification of acceptance:  Tuesday, April 22nd, 2008

Prospective meeting organizers are invited to submit a completed
meeting proposal form to the POPL 2009 workshop chair (Yitzhak
Mandelbaum) by March 10th, 2008.  Please note that this is a firm
deadline.  Organizers will be notified if their proposal is accepted
by April 22nd, 2008, and, if successful, are required to produce a
final report after the workshop has taken place that is suitable for
publication in SIGPLAN Notices.

** Selection committee **

The event proposals will be evaluated by a committee comprising the
following members of the POPL 2009 organising committee, together with
the members of the SIGPLAN executive committee.

Yitzhak Mandelbaum   AT&T Labs - Research        Workshops chair
Zhong Shao           Yale University             General chair
Benjamin Pierce      University of Pennsylvania  Program chair

** Further information **

For the full Call for Workshop and Co-located Event Proposals and all
of the associated forms, visit the POPL 2009 website, or access them
directly at:

A copy of this announcement can be found at:

Any queries regarding POPL 2009 co-located event proposals should be
addressed to the workshops chair (Yitzhak Mandelbaum), via email to
popl-workshops *at*

Ocaml Meeting's talks available


Gabriel Kerneis:
I recorded the talks during the Ocaml Meeting. They are available (raw 
from the recorder). Links here (at the top of the page): 

Any help welcomed to improve it (cut the silences, split into several 
smaller files, etc).
Earlier, Sylvain Le Gall had said:
You can already read every presentations on the website (.pdf and .odp).
At one time in the future, i will also put the video of every talks
somewhere (YouTube?) and a link on the wiki page.
Hezekiah M. Carty said:
There are IRC transcripts available here: which may clarify things

Using folding to read the cwn in vim 6+

Here is a quick trick to help you read this CWN if you are viewing it using vim (version 6 or greater).

:set foldmethod=expr
:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'<1':1

If you know of a better way, please let me know.

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