Previous week Up Next week

Hello

Here is the latest Caml Weekly News, for the week of February 13 to 20, 2007.

  1. An OCaml Summer Project proposal
  2. OS X, main program in C, No bytecode file specified
  3. OCaml SQLite3 bindings
  4. LSD mount utilities, version 1.3

An OCaml Summer Project proposal

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/18f8f11dc06982c7/607161c6bc08f816#607161c6bc08f816

David MENTRE announced:
If you are a student, you want to apply to OCaml Summer Project 
(http://osp2007.janestcapital.com/) but you don't have a subject at 
hand, we have a project for you: ;-) 
    *Write an OCaml web interface for the demexp software* 

Demexp is an electronic voting software designed for direct democracy 
with special features (Condorcet voting algorithm, vote delegation, 
vote change at any time, ...). More information at https://demexp.org/ 
 I personally hope that one day people are going to come to OCaml 
because of demexp. :-) 

Currently, the demexp software is a client/server application, 
entirely written in OCaml. We use LablGTK for the client which is 
supported on Windows and Linux. But in order to ease deployment of our 
software, we need a web interface that could be accessed through a 
regular web browser. We have a very rudimentary prototype of such a 
web interface (written with WDialog) but a more elaborate and 
maintainable interface is heartily needed. 

A first draft of things to implement is given in those messages: 
  http://www.mail-archive.com/demexp-dev%40nongnu.org/msg00932.html 
  http://www.mail-archive.com/demexp-dev%40nongnu.org/msg00940.html 

Such an interface could be implemented with a modern OCaml web 
framework like Ocsigen. Our software is generally under GNU GPL 
license but we can use another one if desired (BSD like for example). 

Feel free to ask questions or comments, but preferably on
demexp-dev@mailing list or directly to myself to avoid polluting 
caml-list.
			

OS X, main program in C, No bytecode file specified

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/20b8f6a75b75fc17/d73dcb73f7392edd#d73dcb73f7392edd

John Whitington asked and EL CHAAR Rabih answered:
> I have a main program in C, and some ocaml code. I usually compile to 
> native code using ocamlopt -output-obj and then have XCode compile the
> C and link the whole together. This works well. 
> 
> However, due to a bug which prevents my using natively compiled code at 
> the moment, I'm trying to replicate the situation with bytecode. 
> 
> So now, I use ocamlc -output-obj, and link camlrun instead of asmrun. 
> 
> This compiles and links but, when run, gives "No bytecode file specified". 
> 
> The executable is not being stripped. I'm using Ocaml 3.09.3 on 
> OSX 10.4/ppc. 
> 
> Can anyone suggest what may be wrong?

What parameters are you passing in you caml_startup call? 
I usually do the following 

  char * argv1[2]; 
  argv1[0]="--"; 
  argv1[1]=NULL; 
  caml_startup(argv1);
			

OCaml SQLite3 bindings

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/6ddade9286c59622/618d232937ebe975#618d232937ebe975

Markus Mottl announced:
There is a new version of SQLite3-bindings for OCaml available as a 
Godi-package now.  The initial version was written by Christian Szegedy 
about two years ago, but does not seem to have been maintained since then. 
I have improved the C-stubs to fix a few things and make the library work 
better in multi-threaded environments, cleaned up the API, and documented 
it.  The library is not quite backwards compatible to Christian's version, 
but it should take very little effort only to update applications using it. 

Just select the package "godi-sqlite3" in Godi to install the library.  You 
can then link with the findlib package "sqlite3", and access the library 
through module "Sqlite3". 

The source code is available here: 
http://ocaml.info/home/ocaml_sources.html#ocaml-sqlite3 

Best regards, 
Markus 

P.S.: I haven't managed to get feedback from Christian yet so I don't know 
whether he's fine with my changes, but it is likely that the current API 
will remain stable.
			

LSD mount utilities, version 1.3

Archive: http://groups.google.com/group/fa.caml/browse_frm/thread/6bded05ff70ae61a/2eff8fd25ab3efbd#2eff8fd25ab3efbd

M E Leypold announced:
    Release 1.3 of LSD mount utilities with mkfs, fsck and LUKS support 
    ___________________________________________________________________ 

    A new version (1.3) of the LSD mount utilities has been released. 

      - LUKS support has been tested (by Alexander Ulrich) and seems to be OK. 

      - Basic versions of mkfs.lcrypt and fsck.lcrypt have been added: 
        You can now use mkfs to create a file system on your encrypted 
        device and fsck to check your file system. 

      - The file USAGE (see below) is intended to be the beginning of 
        a user manual. 

    LSD mount utilities are written in OCaml. 

    Regards -- M E Leypold, 16 Feb 2007. 

*   About 
    ===== 

    The LSD mount utilities assist in setting up (creating) and 
    mounting of encrypted loopback file systems in Linux 2.4 and 2.6. 

    They also enable users (not only root) to mount encrypted 
    file systems if appropriate entries have been added to /etc/fstab. 

    The LSD mount utilities are licensed/distributed under the the 
    terms of the GPL Version 2 (no later version). We'll usually be 
    happy though to relicense under other OS licenses, but you have to 
    ask and get the licensing change from us in writing. 

    The LSD mount utilities are available from 
    http://software.m-e-leypold.de. Read the README file from the 
    distribution before using the software! 

*   How to get more information and help 
    ==================================== 

    Information on recent development and plans and updated 
    documentation will be posted at 

      http://www.etc-network.de/blog/mel/projects/lsd-mount-utilities 

    If you need help, have questions concerning the LSD mount 
    utilities or have suggestions for further implementation you can 
    write the developer at 

      development-2006-8ecbb5cc8a-REMOVE-THIS@AND-THAT-m-e-leypold.de

    I don't guarantee support, but will usually do my best to help. 

*   How to use (excerpt from USAGE) 
    =============================== 

    PLEASE DO READ the file USAGE in the distribution. The following 
    excerpt is only intended to give you a basic idea how things work 
    with LSD mount utilities (i.e. that the hide all losetup and 
    cryptsetup stuff from the user). 

**  Creating an encrypted file system 
    --------------------------------- 

    Before you can make an encrypted file system you need to create an 
    image file and preferably fill it with random noise: 

      dd if=/dev/urandom of=/secret/image 

    Given an image files a encrypted file systems can be initialized 
    with plain mkfs: 

      mkfs -t lcrypt /secret/image 10000 

    The 'blocks' number is optional (you usually can leave it 
    out). You'll be asked for the passphrase twice. 

**  Checking an encrypted file system 
    --------------------------------- 

    An encrypted file system can be checked passing '-t lcrypt' to fsck. 

      fsck -t lcrypt /secret/image 

    You will, of course be asked for the passphrase. 

    If there is an entry in /etc/fstab (see the next sections) which 
    already gives the type of /secret/image as lcrypt, the '-t lcrypt' 
    might be omitted: 

      fsck /secret/image 

**  Mounting an encrypted file system 
    ---------------------------------- 

    To mount an encrypted file system you can pass '-t lcrypt' to 
    mount: 

      mount -t lcrypt /data/encrypted-image /mnt 

    You'll be asked for the passphrase. 

    If there is an entry in /etc/fstab (see the next sections) which 
    already gives the type of /secret/image as lcrypt, the '-t lcrypt' 
    and the mount point might be omitted. 

      mount /data/encrypted-image 

**  Setting up encrypted file systems in /etc/fstab 
    ----------------------------------------------- 

    Use lcrypt as file system type. Use the option 'user', if 
    non-privileged users should be able to mount the device: 

      /etc/fstab: 
      | 
      ... 
      | 
      | /data/encrypted-image /secret-mnt lcrypt  rw,noauto,user,exec 0 0 
      | 

**  Loclean: Clean up loopback devices 
    ---------------------------------- 

    Loclean can only be used by root: 

      loclean 

    and will try to remove all associations with files from loopback 
    devices (/dev/loop*) that are not currently in use.
			

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