[darcs-devel] Moving system code to Haskell

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Fri Aug 26 09:14:32 PDT 2005


    Sat Jul 30 16:17:03 CEST 2005  Ian Lynagh <igloo at earth.li>
      * Move atomic_create/sloppy_atomic_create to Compat

    Sat Jul 30 15:12:05 CEST 2005  Ian Lynagh <igloo at earth.li>
      * Move maybe_relink out of compat.c

I believe this to be a mistake.  A very dangerous mistake at that.

All of this is rather subtle system code, that makes a lot of efforts
to avoid race conditions.  Because it could be broken by small
differences in implementation of the primitives it uses, it carefully
avoids using any library code, but instead uses raw system calls.

By moving this code to Haskell, we're becoming dependent on the
atomicity behaviour of Haskell library calls, which is undocumented
and might change between releases.  Thus, it is quite likely that the
change breaks Darcs over NFS, at least in some versions of Ghc.

An additional concern is that the people who can do correct atomicity
over exotic file systems are most likely C programmers.  By moving
this code to Haskell, we make it impossible to people like the NFSv4,
LUFS or FUSE developers to check our code over their filesystems.

Ian, I would like to strongly encourage you to revert these changes.

                                        Juliusz




More information about the darcs-devel mailing list