build: Include bootstrap.sh in tarball.
[8sync.git] / NEWS
1 # -*- mode: org; -*-
2
3 #+TITLE: 8sync NEWS
4
5 : Copyright (C) 2015-2016  Christopher Allan Webber
6
7 : Copying and distribution of this file, with or without modification, are
8 : permitted in any medium without royalty provided the copyright notice
9 : and this notice are preserved.
10
11 * 8sync 0.4
12 ** Actors are now "center stage"
13
14 You can now import a toplevel (8sync) module, and this module includes
15 the full actor model system.  The actor model is now *the* way to
16 handle concurrent synchronization in 8sync.  So, 8sync is officially
17 less about its event loop, and more about the actor model.  (It is
18 even possible that in the future, 8sync's actor model will be able to
19 run on another event loop.)
20
21 ** New 8sync tutorial
22
23 The manual as been expanded with a full tutorial, walking from
24 extending an existing actor by writing an irc bot, to writing your own
25 basic actors, to writing network actors.
26
27 ** Better error propagation
28
29 When actors wait on other procedures, the "wait" handling code happens
30 within the actor's message handler, rather than skipping execution
31 from the outside.  This means it's possible to catch a general purpose
32 error named 'hive-unresumable-coroutine within the message handler
33 itself.
34
35 (The name of the symbol in the thrown exception may change in a future
36 release.)
37
38 ** IRC bot is now an actor
39
40 The irc bot code officially has become actor'ified, under the
41 <irc-bot> class.
42
43 ** REPL handling via an actor
44
45 The cooperative REPL code now also is handled via an actor.  See
46 <repl-manager>.
47
48 ** Major simplifications/cleanup of the agenda
49
50 The agenda is significantly less bloated than it was; with actors
51 taking center stage, many previous (and somewhat wonkily written)
52 chunks of code have been removed or simplified.
53
54 ** "from" actor is now implicit in sending a message in <-foo procedures
55
56 For the various <- style procedures, the actor is now explicitly
57 gathered from a parameter managed via the Hive.
58
59 ** New procedures: <-*, <-reply*
60
61 <-* and <-reply* have been added, which like <-wait* and <-reply-wait*
62 are like their non-starred equivalents, except they can take some
63 additional options.
64
65 ** New implicit '*init* and '*cleanup* action handlers.
66
67 There are now action handlers for '*init* and '*cleanup* which are
68 automatically invoked on actor initialization and destruction.
69
70
71 * 8sync 0.3
72
73 ** 8sync now targets Guile 2.2, Guile 2.0 dropped
74
75 In order to take advantage of Guile 2.2's suspendable ports facilities,
76 Guile 2.0 support has been dropped from 8sync.  (The Guile 2.1.X series is
77 the Guile 2.2 preview series.  A minimum of Guile 2.1.4 is required.)
78
79 While this may make 8sync slightly harder to install before major free
80 software distributions catch up (Guix users should have no problem), there
81 are major benefits to be found as well; networked code will be
82 significantly easier to write.  For more information, read on.
83
84
85 ** Suspendable ports overhaul
86
87 Previous 8sync networked code required hooking up a "port request" to the
88 scheduler, which would assign a port listening on a read or write event
89 with a callback.  By making use of Guile 2.2's new [[https://www.gnu.org/software/guile/docs/master/guile.html/Non_002dBlocking-I_002fO.html][suspendable ports]] code,
90 network enabled code mostly is completely straightforward to write.  If a
91 port is set to be nonblocking, attempting to read or write to a port that
92 would normally block will automatically suspend to 8sync's scheduler.  When
93 that port is discovered to be ready to read or write, the agenda will
94 automatically resume the suspended code.  As such, writing nonblocking code
95 looks almost exactly like writing blocking code in Guile... very little
96 extra work needs to be done.
97
98 8sync's internal demos and subsystems have also been updated to this
99 feature.
100
101 Not all ports will work with the new behavior, but most involving a file
102 descriptor will, which is the vast majority of I/O facilities.  Hopefully
103 over time the range of ports which are available to take advantage of this
104 feature will grow.
105
106 ** Overhaul of the "8sync" and "8sync-*" macros / procedures
107
108 The previous 8sync macro was realized to be a flawed design, more or less
109 emulating a synchronous call stack while providing the main feature of
110 yielding.  Thus 8sync, and several related macros (8sync-run-at, 8sync-run,
111 8sync-delay, 8sync-run-delay) have been removed, and 8sync-nowait has been
112 renamed to 8sync.
113
114 This leads to the question, "what is the primary coordination mechanism in
115 8sync between asynchronous processes?"  At least for now, this is the actor
116 subystem.  (While 8sync core continues to not require the actor subsystem,
117 for the reasons just described, many users will want to use it.)
118
119 ** Actor system overhaul
120
121 Given its increased role in 8sync, the actor system has also received
122 several major updates:
123
124 *** send-message and friends deprecated in favor of <- and friends
125
126 send-message, send-message-wait, reply-message, and reply-message-wait have
127 all been removed in favor of what was previously their aliases: <-, <-wait,
128 <-reply, and <-reply-wait.  The semantics are the same.
129
130 *** Message body now "applied" to a procedure
131
132 Previously to access a message body's contents, you used message-ref,
133 since a message body was merely a key-value property list.  There was
134 a special purpose message handler to make accessing the contents of a
135 message's body easier, with define-mhandler.  Now this is no more,
136 since invoking a message handler will call the procedure more or less
137 like so:
138
139 #+BEGIN_SRC scheme
140 (apply this-message-handler actor message (message-body this-message))
141 #+END_SRC
142
143 "Waiting" for a reply message continues to return the message as
144 before, but to access its body, the message is likewise applied, using
145 either "receive-message" or "call-with-message".
146
147 *** New %current-actor parameter
148
149 *** Default message handler now "inheritable"
150
151 The default message handler now looks at the actor slot of the actor
152 and its predecessors, which must have #:allocation #:class or
153 #:each-subclass.  The #:init-value of the actor slot is just an alist
154 of (action-symbol . message-handler).  There is convenient sugar for
155 defining this alist named "build-actions".  Use it!
156
157 If for some reason you want to control the way messages are handled
158 in some way that is different than the general pattern, you may
159 customize the message-handler slot of your actor.
160
161 ** New yield procedure
162
163 Allows asynchronously executing code to voluntarily yield to the scheduler.
164
165 ** New procedure: 8usleep
166
167 Like usleep, but asynchronous.
168
169 * 8sync 0.2
170
171 The primary update to this release is the inclusion of a new actor
172 model subsystem.
173
174 * 8sync 0.1
175
176 This is the first release of 8sync.  Welcome to 8sync!
177
178 The following features are present already in this very first release:
179
180  - An asynchronous event loop
181  - Delimited continuation support via the (8sync) command
182  - IRC bot demo