Previous week Up Next week

Hello

Here is the latest Caml Weekly News, for the week of April 08 to 15, 2008.

  1. maintainer needed for CamlTemplate
  2. CDuce is now in Fedora
  3. break and continue for OCaml
  4. List of sites running in Ocaml?
  5. break and continue v2

maintainer needed for CamlTemplate

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/8eb3d29dbdf780b0#

Benjamin Geer said:
The CamlTemplate library (http://saucecode.org/camltemplate/) needs a 
new maintainer, as I unfortunately no longer have time even to apply 
the occasional patches people send me.  If anyone here uses the 
library and would be interested in maintaining it, please let me know.
			

CDuce is now in Fedora

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/1e913d05d9b4b745#

Continuing this thread from March, Richard Jones said:
It's now in testing in Fedora 8, so you should just be able to install 
cduce directly without enabling any extra repositories. 

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

break and continue for OCaml

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/f2c61836b8a4d94d#

Sanghyeon Seo announced:
I have the first cut of patch to implement break and continue inside 
for and while loops for OCaml. 

http://sparcs.kaist.ac.kr/~tinuviel/devel/ocaml/ 

Patch is against OCaml 3.10.2. All the meat is in bytecomp/bytegen.ml. 
Currently bytecode only. I am working on natvie code and error 
handling when break is used outside loop etc but I thought "releasing 
early" could be useful. 

What do you think?
			
Among the many answers, Luc Maranget said:
I think that you can implement break/continue without altering
the lambda-code (file bytecomp/lambda.mli) by using the existing
'static exception' mechanism :

....
| Lstaticraise of (int * lambda list)
| Lstaticcatch of lambda * (int * Ident.t list) * lambda
....

with the following pretty printing convention (cf. option -dlambda)

(exit i) stands for 'Lstaticraise (i,[])'
(catch e1 with (i) e2) stands for 'Lstaticcatch (e1,(i,[]),e2)'


Then you have for instance
while e1 do e2 done ->

(catch
 (while (e1) (catch  e2 with (icont) ())
with (ibreak) ())

In the loop body e2, break is compiled into (exit ibreak)
and coninue into (exit icont).


It is a bit complicated, but then you get native code compilation for
free.

--
Luc
PS> I make no statement on whether break/continue
   should be added to ocaml!

   But..

     1. Exceptions are already here and they express more flexible
        control flow modifications.

     2. Adding keywords is something that is not easily accepted,
        because it breaks existing code.
			

List of sites running in Ocaml?

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/c7a43b09413594ef#

Berke Durak said:
Ocsigen seems to have sparked an emerging interest for web frameworks written
in functional languages. I'd like to compile an exhaustive list of pages or
sites using Ocaml as frontends or backends, with the technologies they use.
Please do not hesitate to add any past or present running Ocaml site or page,
even if its a personal site.

Public sites:
* Gerd's Camlcity: http://www.camlcity.org/
* The Ocsigen site itself: http://ocsigen.org/
* The Merjis site and Cocanwiki: http://merjis.com/
* The ara and anla servers, part of the EDOS project :
  http://brion.inria.fr/ara http://brion.inria.fr/anla Runs using a small
  multithreaded HTTP module, with gzip compression, and a simple sum type for
  documents.
* I'll insert a shameless plug for a comic strip in french, Massacre à la
  Ronchonneuse (http://ronchonneuse.com/), which runs under my pet Ocaml
  framework thru lighttpd + SCGI; thanks to Sexplib for the persistance!

Many other people rolled their own HTTP servers (for instance Stefano
Zacchiroli's ocaml-http). Please tell if they are or were running somewhere.

* Does ocamlcore.org run under Ocaml?

Off-line generation:
* Alain Frisch's personal site: http://alain.frisch.fr/ generated using Cduce,
  of course

CGIs:
* The Caml Humps, which I assume run as Ocaml CGI scripts:
  http://caml.inria.fr//cgi-bin/hump.en.cgi
* Aurochs parser demo: http://aurochs.fr/cgi/demo.cgi (mine)

Backends:
* I have been told Wink uses Ocaml as a backend.

Intranet:
* Impala at INRIA
* From my Paris 7 days I recall a webapp to allocate teachers and assistants
  to courses. I seem to remember that it was written in Ocaml? I'm sure there
  are other internal apps at Paris 7 in Ocaml.

Possible candidates:
* Lexify
* Jane Street
* Haxe and Motion Twin
			
After many replies, Berke Durak then said:
Thanks for your replies. I've created a list at the Cocan wiki. Please correct
any inaccuracies and provide details, if you can, about what you used.

 http://cocan.org/web_sites_using_ocaml

I don't know what the owners of the COCAN wiki would think about it, but IMHO
it would be appropriate for the authors/maintainers of these sites to explain
the techniques they used in a small page.  Some performance metrics could also
make "dynamic fanboys" envious (I'm thinking of Ruby users frustrated by the
excruciating slowness of that language). This could also apply to other
software projects.

Think of prospective new users looking for what they could do in Ocaml.

BTW the COCAN wiki is a great place for centralized information and the wiki
itself is a joy to use.

PS. I've also added an "Ocaml success stories" page with a list of well-known
Ocaml software (coq, unison, mldonkey, etc.)
			

break and continue v2

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/125642c7b8037acc#

Seo Sanghyeon announced:
This is the revision of break/continue patch I sent. 
http://sparcs.kaist.ac.kr/~tinuviel/devel/ocaml/ 

This patch no longer modifies lambda code, and uses static exception 
instead. bytegen is restored, and break/continue target stack is moved 
to translcore. 

simplify_exits is modified to track whether exit is in tail position. 
It no longer replaces exit with handler when exit is not in tail 
position. This is done with two hash tables; I'd like to hear 
suggestions for better implementation.
			

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
zM

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