Changes between Version 5 and Version 6 of BinaryIO


Ignore:
Timestamp:
Jan 12, 2006 2:01:09 AM (8 years ago)
Author:
dons@…
Comment:

some clarifications in response to JohnGoerzen?'s comments

Legend:

Unmodified
Added
Removed
Modified
  • BinaryIO

    v5 v6  
    22[[PageOutline]] 
    33 
    4 Haskell 98 treats I/O as character-based, and lacks a well-defined mechanism for binary I/O. However, a number of external libraries exist providing various forms of binary I/O. 
     4Binary I/O is a critical need in Haskell for many real-world problems. Haskell 98 treats I/O as character-based, and lacks a well-defined mechanism for binary I/O. However, a number of external libraries exist providing various forms of binary I/O. 
    55 
    66Two forms of binary I/O are considered here: 
    7  * Word8 based extensions to Syste.IO, and 
     7 * Word8 based extensions to System.IO, and 
    88 * Typeclass-based Binary I/O (referred to as Binary) for serialising arbitrary data types, layered over Word8 extensions 
    99 
     
    2323=== Proposal 1 === 
    2424 * The simplest implementation option is [http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html System.IO], which provides hGetBuf-style I/O. More sophisticated systems can be layered on top, as external libraries. 
    25  * [http://www.cse.unsw.edu.au/~dons/fps.html Packed strings], layered over System.IO, are a related interface, and sometimes used for binary I/O of flat data types. 
     25 * A related library for [http://www.cse.unsw.edu.au/~dons/fps.html Packed strings], layered over System.IO, are a related interface, and sometimes used for binary I/O of flat data types. 
    2626 
    2727=== Proposal 2 === 
     
    3333 * [http://www.cs.helsinki.fi/u/ekarttun/SerTH/ SerTH] is a Binary-alike, which uses Template Haskell to derive serialiser instances for each data type. It's an alternative to using DrIFT (or handwriting) your own Binary instances. Obviously requires TH. Supports serialising cyclic structures 
    3434 * [http://freearc.narod.ru/ ByteStream], a new high-performance serialisation library, using gzip compression. 
     35 * A [http://article.gmane.org/gmane.comp.lang.haskell.cafe/10803 new] optimised binary library 
     36 
     37== Todo == 
     38 
     39 * Clarify relationship between Haskell and C strings (or is that for the FFI?) 
     40 * More clarification of what is meant by `Binary I/O' (i.e. packed strings, packed data, serialisation, ..) 
    3541 
    3642== Pros/Cons : System.IO == 
     
    4753=== Pros === 
    4854 * The Binary class (particularly as implemented in NewBinary) is simple to implement and widely used. 
    49  * Binary IO is an oft requested feature, lack of which is sometimes considered a flaw in Haskell98. 
     55 * Binary IO is a critical feature, lack of which is sometimes considered a flaw in Haskell98. 
    5056 * Difficult to serialise data without this class 
    5157 
    5258=== Cons === 
    53  * There is an overlap with the Storable class that isn't exploited 
    5459 * Doesn't support cyclic structures 
    5560 * Lack of derivability can be annoying