1.0.20.20: fix gencgc on 32 bit platforms with 2gb< heap
[sbcl/pkhuong.git] / contrib / sb-simple-streams / README
blob0a515c4df1fb45990599d5549f8e501d03bf0a73
1 -*- text -*-
3 An implementation of simple streams for sbcl.
5 Simple streams are an extensible streams protocol that avoids some
6 problems with Gray streams.
8 Documentation about simple streams is available at
9 http://www.franz.com/support/documentation/6.2/doc/streams.htm
11 This code was originally written by Paul Foley for cmucl; Paul's
12 version is now in cmucl cvs.
14 The port to sbcl was done by Rudi Schlatte (rudi@constantly.at).
16 This implementation should be considered Alpha-quality; the basic
17 framework is there, but many classes are just stubs at the moment.
18 See simple-stream-test.lisp for things that should work.
22 Known differences to the ACL behaviour:
24 - open not return a simple-stream by default.  This can be
25   adjusted; see default-open-class in the file cl.lisp
31 ==================================================
33 Some sketchy notes about the simple-streams architecture, at least
34 partly for my own benefit
36 (For all the details, please see Franz' documentation)
38 Motivation:
40 If you want to extend a given Gray stream, is it enough to supply a
41 method for stream-write-byte, or do you have to overwrite
42 stream-write-sequence as well?  How do you extend your Gray socket
43 stream to support chunked stream encoding for HTTP/1.1?  Is
44 stream-read-char-no-hang required to call stream-listen, then
45 stream-read-char?  Simple-streams solve these protocol problems by
46 implementing a device layer following a buffering protocol and a thin
47 "strategy" layer that provides the functionality for the normal CL
48 stream semantics.
50 The device layer at the bottom deals with transferring chunks of bytes
51 between a buffer and a device (socket, file, printer, what-have-you).
52 The top layer is the familiar CL API (read-line, write-sequence, open,
53 etc).  The strategy layer in the middle translates between the
54 buffer-of-bytes and CL stream world-view, dealing with
55 byte<->character conversion, line-ending and stream-external-format
56 conventions, etc.
58 Implementing a new type of stream is a matter of extending the right
59 stream class and implementing device-read, device-write, device-extend
60 & friends.  single-channel-simple-stream is a class where there is one
61 buffer for both input and output (this is appropriate e.g. for a file).  The
62 dual-channel-simple-stream class deals with devices that require
63 separate buffers for input and output (e.g. sockets).
65 Other character representations (Unicode, other multi-byte encodings)
66 are implemented at the strategy level.  The Franz documentation is
67 unclear about this, but it seems that encodings take an active part
68 ("the encoding reads as many bytes as are necessary to compose a
69 character", or words to that effect).  This is not implemented in the
70 present code (neither is it in Paul Foley's implementation), and will
71 not be until sbcl gains Unicode abilities, but it would be nice to
72 have it at least stubbed out in the implementation.