guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Announcing 8sync: an asynchronous programming language for Guile


From: Christopher Allan Webber
Subject: Announcing 8sync: an asynchronous programming language for Guile
Date: Mon, 23 Nov 2015 17:51:27 -0600

Hello all,

Some of you may remember the thread on this list about Guile needing an
asynchronous programming library, with a writeup from a conversation
David Thompson, Mark Weaver, guest star Andrew Engelbrecht, and I had at
LibrePlanet:

  https://lists.gnu.org/archive/html/guile-devel/2015-10/msg00015.html

Well! I've begun work on an asynchronous programming language called
"8sync" for Guile (pronounced "eight-sync", as in "eight-synchronous
communication" :))!  You can find it here:

  https://notabug.org/cwebber/8sync

A nice little logo here:

  http://dustycloud.org/gfx/goodies/8sync-protologo2.png

Hm, I need a nice website to go with that logo! :)

It makes significant use of delimited continuations.  You can do things
like this:

  (define (my-number-talker)
    (format #t
      "Oh boy, looks like we got back ~a!\n"
      (%sync (%run (+ 1 2 3 (complicated-number-code 38))))))

... and the complicated-number-code will launch asynchronously, but wake
back up the appropriate function appropriately.  You can also set timed
events, read and write to ports asynchronously, and etc.  It has a nice
non-blocking loop, and personally I've found it to be a delight to use.

(Also should I be calling that thing (%sync) or (8sync)?  The jury is
out, so in the meanwhile, it's an alias!)

Anyway, there's a lot to be done... I'm not at a 0.1 release quite yet,
but am rapidly approaching it.

If you're interested in giving it a whirl, there's an IRC bot that ships
with it already in the demos/ directory.  Oh yeah, did I mention that
this makes use of the cooperative REPL system in Guile?  This means you
can *live hack your asynchronous code*.  Pretty cool!  (As such, we've
got a little guest in #guile right now named "syncbot"...)

More to come soon, including documentation, web programming examples, an
actor model implementation layered on top, and more functional
programming utilities, including maybe an Elm-like time traveling
debugger.  (There's currently some mutation under the hood, but all of
it can be refactored to be purely functional... with the exception of a
parameter that's used to find the current agenda.  Even that though,
I'll be writing code so you can schedule explicitly to the agenda
shortly if you really are upset by that one impurity.  Sure makes doing
%sync / 8sync calls nice though...)

Anyway, I'm having a ton of fun with this project.  Give it a
try... maybe you will too!

 - Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]