231ddde9beba446fd5ffe3a60fa63f2bd29d5d00
[8sync.git] / doc / 8sync.texi
1 \input texinfo   @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename 8sync.info
4 @settitle 8sync
5 @c %**end of header
6 @copying
7 Copyright @copyright{} 2015  Christopher Allan Webber @email{cwebber@@dustycloud.org}
8 @end copying
9
10 @quotation
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.3
13 or any later version published by the Free Software Foundation;
14 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
15 A copy of the license is included in the section entitled ``GNU
16 Free Documentation License''.
17
18 A copy of the license is also available from the Free Software
19 Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}.
20
21 Altenately, this document is also available under the Lesser General
22 Public License, version 3 or later, as published by the Free Software
23 Foundation.
24
25 A copy of the license is also available from the Free Software
26 Foundation Web site at @url{http://www.gnu.org/licenses/lgpl.html}.
27
28 @end quotation
29
30
31 @titlepage
32 @title 8sync 0.1
33 @subtitle Using 8sync, an asynchronous event loop for Guile
34 @author Christopher Allan Webber
35 @page
36 @vskip 0pt plus 1filll
37 @insertcopying
38 @end titlepage
39
40 @c Output the table of the contents at the beginning.
41 @contents
42
43 @ifnottex
44 @node Top
45 @top 8sync
46
47 @insertcopying
48 @end ifnottex
49
50 @c Generate the nodes for this menu with `C-c C-u C-m'.
51
52
53 @c Update all node entries with `C-c C-u C-n'.
54 @c Insert new nodes with `C-c C-c n'.
55
56 @menu
57 * Introduction::
58 * Acknowledgements::
59 * Copying This Manual::
60 * Index::
61 @end menu
62
63 @node Introduction
64 @chapter Introduction
65
66 8sync's goal is to make asynchronous programming easy.  If you've worked
67 with most other asynchronous programming environments, you know that it
68 generally isn't.  Usually asynchronous programming involves entering
69 some sort of ``callback hell''.  Some nicer environments like Asyncio
70 for Python provide coroutines, but even these require a lot of work to
71 carefully line up.
72
73 Coding in 8sync, on the other hand, looks almost entirely like coding
74 anywhere else.  This is because 8sync makes great use of a cool feature
75 in Guile called ``delimited continuations''.  Because of this, you can
76 invoke your asynchronous code with a small wrapper around it, and that
77 code will pop off to complete whatever other task it needs to do, and
78 resume your function when it's ready passing back the appropriate value.
79
80 Now that's pretty cool!
81
82 @node Acknowledgements
83 @chapter Acknowledgements
84
85 8sync has a number of inspirations:
86
87 @itemize @bullet
88 @item
89 @uref{https://docs.python.org/3.5/library/asyncio.html, asyncio}
90 for Python provides a nice asynchronous programming environment, and
91 makes great use of coroutines.  It's a bit more difficult to work with
92 than 8sync (or so thinks the author) because you have to ``line up''
93 coroutines.
94
95 @item
96 @uref{http://dthompson.us/pages/software/sly.html, Sly}
97 by David Thompson is an awesome functional reactive game programming
98 library for Guile.  If you want to write graphical games, Sly is almost
99 certainly a better choice than 8sync.  Thanks to David for being very
100 patient in explaining tough concepts; experience on hacking Sly greatly
101 informed 8sync's development.  (Check out Sly, it rocks!)
102
103 @item
104 Reading @uref{https://mitpress.mit.edu/sicp/, SICP}, particularly
105 @uref{https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-19.html#%_chap_3,
106       Chapter 3's writings on concurrent systems},
107 greatly informed 8sync's design.
108
109 @item
110 Finally, @uref{https://docs.python.org/3.5/library/asyncio.html, XUDD}
111 was an earlier ``research project'' that preceeded 8sync.  It attempted
112 to bring an actor model system to Python.  However, the author
113 eventually grew frustrated with some of Python's limitations, fell in
114 love with Guile, and well... now we have 8sync, which is much more
115 general anyway.
116
117 @end itemize
118
119 The motivation to build 8sync came out of
120 @uref{https://lists.gnu.org/archive/html/guile-devel/2015-10/msg00015.html, a conversation}
121 at the FSF 30th party between Mark Weaver, David Thompson, Andrew
122 Engelbrecht, and Christopher Allan Webber over how to build
123 an asynchronous event loop for Guile and just what would be needed.
124
125 A little over a month after that, hacking on 8sync began!
126
127
128 @node Copying This Manual
129 @appendix Copying This Manual
130
131 This manual is licensed under the GNU Free Documentation License, with
132 no invariant sections.  At your option, it is also available under the
133 GNU Lesser General Public License, as published by the Free Software
134 Foundation, version 3 or any later version.
135
136 @menu
137 * GNU Free Documentation License::  License for copying this manual.
138 @end menu
139
140 @c Get fdl.texi from http://www.gnu.org/licenses/fdl.html
141 @node GNU Free Documentation License
142 @section GNU Free Documentation License
143 @include fdl.texi
144
145 @node Index
146 @unnumbered Index
147
148 @syncodeindex tp fn
149 @syncodeindex vr fn
150 @printindex fn
151
152 @bye
153
154 @c 8sync.texi ends here