DRAFT irc: Remove 0.4.2 interface. -- after 0.5.0 release.
[8sync.git] / NEWS
1 # -*- mode: org; -*-
2
3 #+TITLE: 8sync NEWS
4
5 : Copyright (C) 2015-2017  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.5.0
12
13 ** Updated irc-bot actor
14
15 Irc-bot now uses code from (snuik irc) for proper parsing of IRC
16 messages and has an updated `handle-message' api that takes an
17 <irc:message> record.  The `handle-line/handle-misc-input' handlers
18 are still available and will be removed afer 0.5.0.
19
20
21 ** Websocket client actor
22
23 New websocket code, courtesy David Thompson's work on guile-websocket.
24 Currently this code is snarfed straight into 8sync; in the future
25 8sync may use guile-websocket as an independent library.
26
27 ** Some MinGW support
28
29 Use of SIGPIPE and /dev/urandom is avoided when building for MinGW.
30
31
32 * 8sync 0.4.2
33
34 AKA, 8sync FOSDEM edition!  Contains all the code necessary to run
35 Mudsync, as demonstrated at FOSDEM 2017.
36
37 ** Web server actor
38
39 The old webserver code has been converted to being wrapped in an
40 actor.
41
42 ** Websocket server actor
43
44 New websocket code, courtesy David Thompson's work on guile-websocket.
45 Currently this code is snarfed straight into 8sync; in the future
46 8sync may use guile-websocket as an independent library.
47
48 ** REPL can notify subscribers
49
50 Subscribers can be notified to run after every tick of the REPL loop.
51 This way other actors who are looking for particular commands entered
52 at the REPL triggering something (for instance, inject-gameobj! in
53 Mudsync) have a chance to run.
54
55 * 8sync 0.4
56 ** Actors are now "center stage"
57
58 You can now import a toplevel (8sync) module, and this module includes
59 the full actor model system.  The actor model is now *the* way to
60 handle concurrent synchronization in 8sync.  So, 8sync is officially
61 less about its event loop, and more about the actor model.  (It is
62 even possible that in the future, 8sync's actor model will be able to
63 run on another event loop.)
64
65 ** New 8sync tutorial
66
67 The manual as been expanded with a full tutorial, walking from
68 extending an existing actor by writing an irc bot, to writing your own
69 basic actors, to writing network actors.
70
71 ** Better error propagation
72
73 When actors wait on other procedures, the "wait" handling code happens
74 within the actor's message handler, rather than skipping execution
75 from the outside.  This means it's possible to catch a general purpose
76 error named 'hive-unresumable-coroutine within the message handler
77 itself.
78
79 (The name of the symbol in the thrown exception may change in a future
80 release.)
81
82 ** IRC bot is now an actor
83
84 The irc bot code officially has become actor'ified, under the
85 <irc-bot> class.
86
87 ** REPL handling via an actor
88
89 The cooperative REPL code now also is handled via an actor.  See
90 <repl-manager>.
91
92 ** Major simplifications/cleanup of the agenda
93
94 The agenda is significantly less bloated than it was; with actors
95 taking center stage, many previous (and somewhat wonkily written)
96 chunks of code have been removed or simplified.
97
98 ** "from" actor is now implicit in sending a message in <-foo procedures
99
100 For the various <- style procedures, the actor is now explicitly
101 gathered from a parameter managed via the Hive.
102
103 ** New procedures: <-*, <-reply*
104
105 <-* and <-reply* have been added, which like <-wait* and <-reply-wait*
106 are like their non-starred equivalents, except they can take some
107 additional options.
108
109 ** New implicit '*init* and '*cleanup* action handlers.
110
111 There are now action handlers for '*init* and '*cleanup* which are
112 automatically invoked on actor initialization and destruction.
113
114
115 * 8sync 0.3
116
117 ** 8sync now targets Guile 2.2, Guile 2.0 dropped
118
119 In order to take advantage of Guile 2.2's suspendable ports facilities,
120 Guile 2.0 support has been dropped from 8sync.  (The Guile 2.1.X series is
121 the Guile 2.2 preview series.  A minimum of Guile 2.1.4 is required.)
122
123 While this may make 8sync slightly harder to install before major free
124 software distributions catch up (Guix users should have no problem), there
125 are major benefits to be found as well; networked code will be
126 significantly easier to write.  For more information, read on.
127
128
129 ** Suspendable ports overhaul
130
131 Previous 8sync networked code required hooking up a "port request" to the
132 scheduler, which would assign a port listening on a read or write event
133 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,
134 network enabled code mostly is completely straightforward to write.  If a
135 port is set to be nonblocking, attempting to read or write to a port that
136 would normally block will automatically suspend to 8sync's scheduler.  When
137 that port is discovered to be ready to read or write, the agenda will
138 automatically resume the suspended code.  As such, writing nonblocking code
139 looks almost exactly like writing blocking code in Guile... very little
140 extra work needs to be done.
141
142 8sync's internal demos and subsystems have also been updated to this
143 feature.
144
145 Not all ports will work with the new behavior, but most involving a file
146 descriptor will, which is the vast majority of I/O facilities.  Hopefully
147 over time the range of ports which are available to take advantage of this
148 feature will grow.
149
150 ** Overhaul of the "8sync" and "8sync-*" macros / procedures
151
152 The previous 8sync macro was realized to be a flawed design, more or less
153 emulating a synchronous call stack while providing the main feature of
154 yielding.  Thus 8sync, and several related macros (8sync-run-at, 8sync-run,
155 8sync-delay, 8sync-run-delay) have been removed, and 8sync-nowait has been
156 renamed to 8sync.
157
158 This leads to the question, "what is the primary coordination mechanism in
159 8sync between asynchronous processes?"  At least for now, this is the actor
160 subystem.  (While 8sync core continues to not require the actor subsystem,
161 for the reasons just described, many users will want to use it.)
162
163 ** Actor system overhaul
164
165 Given its increased role in 8sync, the actor system has also received
166 several major updates:
167
168 *** send-message and friends deprecated in favor of <- and friends
169
170 send-message, send-message-wait, reply-message, and reply-message-wait have
171 all been removed in favor of what was previously their aliases: <-, <-wait,
172 <-reply, and <-reply-wait.  The semantics are the same.
173
174 *** Message body now "applied" to a procedure
175
176 Previously to access a message body's contents, you used message-ref,
177 since a message body was merely a key-value property list.  There was
178 a special purpose message handler to make accessing the contents of a
179 message's body easier, with define-mhandler.  Now this is no more,
180 since invoking a message handler will call the procedure more or less
181 like so:
182
183 #+BEGIN_SRC scheme
184 (apply this-message-handler actor message (message-body this-message))
185 #+END_SRC
186
187 "Waiting" for a reply message continues to return the message as
188 before, but to access its body, the message is likewise applied, using
189 either "receive-message" or "call-with-message".
190
191 *** New %current-actor parameter
192
193 *** Default message handler now "inheritable"
194
195 The default message handler now looks at the actor slot of the actor
196 and its predecessors, which must have #:allocation #:class or
197 #:each-subclass.  The #:init-value of the actor slot is just an alist
198 of (action-symbol . message-handler).  There is convenient sugar for
199 defining this alist named "build-actions".  Use it!
200
201 If for some reason you want to control the way messages are handled
202 in some way that is different than the general pattern, you may
203 customize the message-handler slot of your actor.
204
205 ** New yield procedure
206
207 Allows asynchronously executing code to voluntarily yield to the scheduler.
208
209 ** New procedure: 8usleep
210
211 Like usleep, but asynchronous.
212
213 * 8sync 0.2
214
215 The primary update to this release is the inclusion of a new actor
216 model subsystem.
217
218 * 8sync 0.1
219
220 This is the first release of 8sync.  Welcome to 8sync!
221
222 The following features are present already in this very first release:
223
224  - An asynchronous event loop
225  - Delimited continuation support via the (8sync) command
226  - IRC bot demo