summaryrefslogtreecommitdiff
path: root/NEWS
blob: aa192de9cefeb066606c5ef3256ddee20bcf4db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# -*- mode: org; -*-

#+TITLE: 8sync NEWS

: Copyright (C) 2015-2016  Christopher Allan Webber
: 
: Copying and distribution of this file, with or without modification, are
: permitted in any medium without royalty provided the copyright notice
: and this notice are preserved.

* 8sync 0.4
** Actors are now "center stage"

You can now import a toplevel (8sync) module, and this module includes
the full actor model system.  The actor model is now *the* way to
handle concurrent synchronization in 8sync.  So, 8sync is officially
less about its event loop, and more about the actor model.  (It is
even possible that in the future, 8sync's actor model will be able to
run on another event loop.)

** New 8sync tutorial

The manual as been expanded with a full tutorial, walking from
extending an existing actor by writing an irc bot, to writing your own
basic actors, to writing network actors.

** Better error propagation

When actors wait on other procedures, the "wait" handling code happens
within the actor's message handler, rather than skipping execution
from the outside.  This means it's possible to catch a general purpose
error named 'hive-unresumable-coroutine within the message handler
itself.

(The name of the symbol in the thrown exception may change in a future
release.)

** IRC bot is now an actor

The irc bot code officially has become actor'ified, under the
<irc-bot> class.

** REPL handling via an actor

The cooperative REPL code now also is handled via an actor.  See
<repl-manager>.

** Major simplifications/cleanup of the agenda

The agenda is significantly less bloated than it was; with actors
taking center stage, many previous (and somewhat wonkily written)
chunks of code have been removed or simplified.

** "from" actor is now implicit in sending a message in <-foo procedures

For the various <- style procedures, the actor is now explicitly
gathered from a parameter managed via the Hive.

** New procedures: <-*, <-reply*

<-* and <-reply* have been added, which like <-wait* and <-reply-wait*
are like their non-starred equivalents, except they can take some
additional options.

** New implicit '*init* and '*cleanup* action handlers.

There are now action handlers for '*init* and '*cleanup* which are
automatically invoked on actor initialization and destruction.


* 8sync 0.3

** 8sync now targets Guile 2.2, Guile 2.0 dropped

In order to take advantage of Guile 2.2's suspendable ports facilities,
Guile 2.0 support has been dropped from 8sync.  (The Guile 2.1.X series is
the Guile 2.2 preview series.  A minimum of Guile 2.1.4 is required.)

While this may make 8sync slightly harder to install before major free
software distributions catch up (Guix users should have no problem), there
are major benefits to be found as well; networked code will be
significantly easier to write.  For more information, read on.


** Suspendable ports overhaul

Previous 8sync networked code required hooking up a "port request" to the
scheduler, which would assign a port listening on a read or write event
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,
network enabled code mostly is completely straightforward to write.  If a
port is set to be nonblocking, attempting to read or write to a port that
would normally block will automatically suspend to 8sync's scheduler.  When
that port is discovered to be ready to read or write, the agenda will
automatically resume the suspended code.  As such, writing nonblocking code
looks almost exactly like writing blocking code in Guile... very little
extra work needs to be done.

8sync's internal demos and subsystems have also been updated to this
feature.

Not all ports will work with the new behavior, but most involving a file
descriptor will, which is the vast majority of I/O facilities.  Hopefully
over time the range of ports which are available to take advantage of this
feature will grow.

** Overhaul of the "8sync" and "8sync-*" macros / procedures

The previous 8sync macro was realized to be a flawed design, more or less
emulating a synchronous call stack while providing the main feature of
yielding.  Thus 8sync, and several related macros (8sync-run-at, 8sync-run,
8sync-delay, 8sync-run-delay) have been removed, and 8sync-nowait has been
renamed to 8sync.

This leads to the question, "what is the primary coordination mechanism in
8sync between asynchronous processes?"  At least for now, this is the actor
subystem.  (While 8sync core continues to not require the actor subsystem,
for the reasons just described, many users will want to use it.)

** Actor system overhaul

Given its increased role in 8sync, the actor system has also received
several major updates:

*** send-message and friends deprecated in favor of <- and friends

send-message, send-message-wait, reply-message, and reply-message-wait have
all been removed in favor of what was previously their aliases: <-, <-wait,
<-reply, and <-reply-wait.  The semantics are the same.

*** Message body now "applied" to a procedure

Previously to access a message body's contents, you used message-ref,
since a message body was merely a key-value property list.  There was
a special purpose message handler to make accessing the contents of a
message's body easier, with define-mhandler.  Now this is no more,
since invoking a message handler will call the procedure more or less
like so:

#+BEGIN_SRC scheme
(apply this-message-handler actor message (message-body this-message))
#+END_SRC

"Waiting" for a reply message continues to return the message as
before, but to access its body, the message is likewise applied, using
either "receive-message" or "call-with-message".

*** New %current-actor parameter

*** Default message handler now "inheritable"

The default message handler now looks at the actor slot of the actor
and its predecessors, which must have #:allocation #:class or
#:each-subclass.  The #:init-value of the actor slot is just an alist
of (action-symbol . message-handler).  There is convenient sugar for
defining this alist named "build-actions".  Use it!

If for some reason you want to control the way messages are handled
in some way that is different than the general pattern, you may
customize the message-handler slot of your actor.

** New yield procedure

Allows asynchronously executing code to voluntarily yield to the scheduler.

** New procedure: 8usleep

Like usleep, but asynchronous.

* 8sync 0.2

The primary update to this release is the inclusion of a new actor
model subsystem.

* 8sync 0.1

This is the first release of 8sync.  Welcome to 8sync!

The following features are present already in this very first release:

 - An asynchronous event loop
 - Delimited continuation support via the (8sync) command
 - IRC bot demo