5 : Copyright (C) 2015-2017 Christopher Allan Webber
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.
13 AKA, 8sync FOSDEM edition! Contains all the code necessary to run
14 Mudsync, as demonstrated at FOSDEM 2017.
18 The old webserver code has been converted to being wrapped in an
21 ** Websocket server actor
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.
27 ** REPL can notify subscribers
29 Subscribers can be notified to run after every tick of the REPL loop.
30 This way other actors who are looking for particular commands entered
31 at the REPL triggering something (for instance, inject-gameobj! in
32 Mudsync) have a chance to run.
35 ** Actors are now "center stage"
37 You can now import a toplevel (8sync) module, and this module includes
38 the full actor model system. The actor model is now *the* way to
39 handle concurrent synchronization in 8sync. So, 8sync is officially
40 less about its event loop, and more about the actor model. (It is
41 even possible that in the future, 8sync's actor model will be able to
42 run on another event loop.)
46 The manual as been expanded with a full tutorial, walking from
47 extending an existing actor by writing an irc bot, to writing your own
48 basic actors, to writing network actors.
50 ** Better error propagation
52 When actors wait on other procedures, the "wait" handling code happens
53 within the actor's message handler, rather than skipping execution
54 from the outside. This means it's possible to catch a general purpose
55 error named 'hive-unresumable-coroutine within the message handler
58 (The name of the symbol in the thrown exception may change in a future
61 ** IRC bot is now an actor
63 The irc bot code officially has become actor'ified, under the
66 ** REPL handling via an actor
68 The cooperative REPL code now also is handled via an actor. See
71 ** Major simplifications/cleanup of the agenda
73 The agenda is significantly less bloated than it was; with actors
74 taking center stage, many previous (and somewhat wonkily written)
75 chunks of code have been removed or simplified.
77 ** "from" actor is now implicit in sending a message in <-foo procedures
79 For the various <- style procedures, the actor is now explicitly
80 gathered from a parameter managed via the Hive.
82 ** New procedures: <-*, <-reply*
84 <-* and <-reply* have been added, which like <-wait* and <-reply-wait*
85 are like their non-starred equivalents, except they can take some
88 ** New implicit '*init* and '*cleanup* action handlers.
90 There are now action handlers for '*init* and '*cleanup* which are
91 automatically invoked on actor initialization and destruction.
96 ** 8sync now targets Guile 2.2, Guile 2.0 dropped
98 In order to take advantage of Guile 2.2's suspendable ports facilities,
99 Guile 2.0 support has been dropped from 8sync. (The Guile 2.1.X series is
100 the Guile 2.2 preview series. A minimum of Guile 2.1.4 is required.)
102 While this may make 8sync slightly harder to install before major free
103 software distributions catch up (Guix users should have no problem), there
104 are major benefits to be found as well; networked code will be
105 significantly easier to write. For more information, read on.
108 ** Suspendable ports overhaul
110 Previous 8sync networked code required hooking up a "port request" to the
111 scheduler, which would assign a port listening on a read or write event
112 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,
113 network enabled code mostly is completely straightforward to write. If a
114 port is set to be nonblocking, attempting to read or write to a port that
115 would normally block will automatically suspend to 8sync's scheduler. When
116 that port is discovered to be ready to read or write, the agenda will
117 automatically resume the suspended code. As such, writing nonblocking code
118 looks almost exactly like writing blocking code in Guile... very little
119 extra work needs to be done.
121 8sync's internal demos and subsystems have also been updated to this
124 Not all ports will work with the new behavior, but most involving a file
125 descriptor will, which is the vast majority of I/O facilities. Hopefully
126 over time the range of ports which are available to take advantage of this
129 ** Overhaul of the "8sync" and "8sync-*" macros / procedures
131 The previous 8sync macro was realized to be a flawed design, more or less
132 emulating a synchronous call stack while providing the main feature of
133 yielding. Thus 8sync, and several related macros (8sync-run-at, 8sync-run,
134 8sync-delay, 8sync-run-delay) have been removed, and 8sync-nowait has been
137 This leads to the question, "what is the primary coordination mechanism in
138 8sync between asynchronous processes?" At least for now, this is the actor
139 subystem. (While 8sync core continues to not require the actor subsystem,
140 for the reasons just described, many users will want to use it.)
142 ** Actor system overhaul
144 Given its increased role in 8sync, the actor system has also received
145 several major updates:
147 *** send-message and friends deprecated in favor of <- and friends
149 send-message, send-message-wait, reply-message, and reply-message-wait have
150 all been removed in favor of what was previously their aliases: <-, <-wait,
151 <-reply, and <-reply-wait. The semantics are the same.
153 *** Message body now "applied" to a procedure
155 Previously to access a message body's contents, you used message-ref,
156 since a message body was merely a key-value property list. There was
157 a special purpose message handler to make accessing the contents of a
158 message's body easier, with define-mhandler. Now this is no more,
159 since invoking a message handler will call the procedure more or less
163 (apply this-message-handler actor message (message-body this-message))
166 "Waiting" for a reply message continues to return the message as
167 before, but to access its body, the message is likewise applied, using
168 either "receive-message" or "call-with-message".
170 *** New %current-actor parameter
172 *** Default message handler now "inheritable"
174 The default message handler now looks at the actor slot of the actor
175 and its predecessors, which must have #:allocation #:class or
176 #:each-subclass. The #:init-value of the actor slot is just an alist
177 of (action-symbol . message-handler). There is convenient sugar for
178 defining this alist named "build-actions". Use it!
180 If for some reason you want to control the way messages are handled
181 in some way that is different than the general pattern, you may
182 customize the message-handler slot of your actor.
184 ** New yield procedure
186 Allows asynchronously executing code to voluntarily yield to the scheduler.
188 ** New procedure: 8usleep
190 Like usleep, but asynchronous.
194 The primary update to this release is the inclusion of a new actor
199 This is the first release of 8sync. Welcome to 8sync!
201 The following features are present already in this very first release:
203 - An asynchronous event loop
204 - Delimited continuation support via the (8sync) command