summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-09-11 14:18:29 +0200
committerAndy Wingo <wingo@pobox.com>2016-09-11 14:18:29 +0200
commit4c6c1ed3181ccf954218914f5552c1ea86797282 (patch)
tree4ad1cfa9dd530266edaab1ea84fb11f7b0cb607d
parentMinor TODO.md updates (diff)
downloadguile-fibers-4c6c1ed3181ccf954218914f5552c1ea86797282.tar.gz
README in markdown form
* README.md: Change to markdown. * Makefile.am: Update.
-rw-r--r--Makefile.am2
-rw-r--r--README56
-rw-r--r--README.md89
3 files changed, 91 insertions, 56 deletions
diff --git a/Makefile.am b/Makefile.am
index 15531ff..98eb069 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,6 +47,8 @@ EXTRA_DIST += \
env.in \
HACKING \
COPYING.LESSER \
+ README.md \
+ TODO.md \
$(bin_SCRIPTS) \
$(TESTS) \
examples
diff --git a/README b/README
deleted file mode 100644
index 69c51df..0000000
--- a/README
+++ /dev/null
@@ -1,56 +0,0 @@
-About Fibers
-============
-
-Fibers is a facility that provides Erlang-like concurrency for Guile
-Scheme.
-
-
-A pasteable introduction to using Fibers
-========================================
-
-;; Paste this into your guile interpreter!
-
-(use-modules (fibers))
-
-
-Copying Fibers
-==============
-
-Distribution of Fibers is under the LGPLv3+. See the COPYING file for
-more information.
-
-
-Contact info
-============
-
- Mailing List: guile-user@gnu.org
- Homepage: https://github.com/andywingo/fibers
- Download: https://wingolog.org/pub/fibers/
-
-
-Build dependencies
-==================
-
-* Guile 2.1.3 or newer
- http://www.gnu.org/software/guile/
-
-
-Installation quickstart
-=======================
-
-Install using the standard autotools incantation:
- ./configure --prefix=/opt/guile && make && make install.
-
-Build from Git using ./autogen.sh --prefix=/opt/fibers && make.
-
-You can run without installing, just run './env guile'.
-
-
-Copying this file
-=================
-
-Copyright (C) 2007,2011 Andy Wingo <wingo pobox.com>
-
-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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..07bd878
--- /dev/null
+++ b/README.md
@@ -0,0 +1,89 @@
+# Fibers
+
+Fibers is a facility that provides Erlang-like concurrency for Guile
+Scheme.
+
+
+## A pasteable introduction to using Fibers
+
+```scheme
+;; Paste this into your guile interpreter!
+
+(use-modules (fibers) (fibers channels) (ice-9 match))
+
+(define (server in out)
+ (let lp ()
+ (match (pk 'server-received (get-message in))
+ ('ping! (put-message out 'pong!))
+ ('sup (put-message out 'not-much-u))
+ (msg (put-message out (cons 'wat msg))))
+ (lp)))
+
+(define (client in out)
+ (for-each (lambda (msg)
+ (put-message out msg)
+ (pk 'client-received (get-message in)))
+ '(ping! sup)))
+
+(run-fibers
+ (lambda ()
+ (let ((c2s (make-channel))
+ (s2c (make-channel)))
+ (spawn-fiber (lambda () (server c2s s2c)))
+ (client s2c c2s))))
+```
+
+If you paste the above at into a Guile REPL, it prints out:
+
+```scheme
+;;; (server-received ping!)
+
+;;; (client-received pong!)
+
+;;; (server-received sup)
+
+;;; (client-received not-much-u)
+```
+
+
+## Contact info
+
+Mailing List: `guile-user@gnu.org`
+
+Homepage: https://github.com/wingo/fibers
+
+Download: https://wingolog.org/pub/fibers/
+
+
+## Build dependencies
+
+Guile 2.1.3 or newer (http://www.gnu.org/software/guile/).
+
+
+## Installation quickstart
+
+Install from a release tarball using the standard autotools
+incantation:
+
+```
+./configure --prefix=/opt/guile && make && make install
+```
+
+Build from Git is the same, except run `autoreconf -vif` first.
+
+You can run without installing, just run `./env guile`.
+
+
+## Copying Fibers
+
+Distribution of Fibers is under the LGPLv3+. See the `COPYING` and
+`COPYING.LESSER` files for more information.
+
+
+## Copying this file
+
+Copyright (C) 2016 Free Software Foundation, Inc.
+
+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.