cl-rw

Layered streams for Common Lisp
git clone https://logand.com/git/cl-rw.git/
Log | Files | Refs

commit aa7f32bfd93900ee0e932230f0dc9a52f4ed801c
parent ba99919d4db33b4eca1d91e047308b4063788eb7
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sun,  6 Dec 2015 09:12:21 +0100

try more lisps

Diffstat:
Mcl-rw.asd | 4++--
Mconcurrency.lisp | 12+++++++++---
Mdefault.nix | 39+++++++++++++++++++++++++++++++++------
Mdemo-zappel.lisp | 12++++++++++++
Mrelease.nix | 5+++++
5 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/cl-rw.asd b/cl-rw.asd @@ -36,7 +36,7 @@ (:file "xml") (:file "email") (:file "os") - #-clisp(:file "concurrency") + (:file "concurrency") (:file "css") (:file "html") (:file "socket") @@ -44,7 +44,7 @@ (:file "http") (:file "net") (:file "calendar") - #-clisp(:file "ui") + (:file "ui") (:file "cas") (:file "zip") (:file "string") diff --git a/concurrency.lisp b/concurrency.lisp @@ -29,7 +29,8 @@ :wait-on-semaphore :make-concurrent-queue :make-thread - :make-program-server)) + :make-program-server + :threads-supported-p)) (in-package :rw.concurrency) @@ -108,15 +109,20 @@ ;; (funcall q 3) ;; (funcall q) +(defun threads-supported-p () + #+(or allegro ccl ecl mkcl cmucl sb-thread (and clisp mt)) + t) + (defun make-thread (name fn) - #-(or allegro ccl ecl mkcl cmucl sbcl) + #-(or allegro ccl ecl mkcl cmucl sbcl (and clisp mt)) (error "RW.CONCURRENCY:MAKE-THREAD not ported") #+allegro (mp:process-run-function name fn) #+ccl (ccl:process-run-function name fn) #+ecl (mp:process-run-function name fn) #+mkcl (mt:thread-run-function name fn) #+cmucl (mp:make-process fn :name name) - #+sbcl (sb-concurrency::make-thread fn :name (string name))) + #+sbcl (sb-concurrency::make-thread fn :name (string name)) + #+(and clisp mt) (mt:make-thread fn :name name)) (defun make-program-server (command args writer reader) (let ((p (rw.os:make-program :stream :stream command args nil)) diff --git a/default.nix b/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchgit, sbcl, ccl, ecl, mkcl, lisptype, demo}: +{stdenv, fetchgit, sbcl, ccl, cmucl_binary, clisp, ecl, mkcl, lisptype, demo}: stdenv.mkDerivation rec { name = "cl-rw-demo-${demo}-${lisptype}"; @@ -9,7 +9,13 @@ stdenv.mkDerivation rec { sha256 = "03w7rah4bkzqw2m47jrb0nhwcsk3qq90nqd193b7qbcdwjkr6l4b"; }; - buildInputs = [sbcl ccl ecl mkcl]; + buildInputs = if "sbcl" == "${lisptype}" then [sbcl] + else if "ccl" == "${lisptype}" then [ccl] + else if "cmucl" == "${lisptype}" then [cmucl_binary] + else if "clisp" == "${lisptype}" then [clisp] + else if "ecl" == "${lisptype}" then [ecl] + else if "mkcl" == "${lisptype}" then [mkcl] + else []; sbclBuild = '' sbcl \ @@ -18,22 +24,41 @@ stdenv.mkDerivation rec { --disable-debugger \ --no-sysinit \ --no-userinit \ - --load "${sbcl}/lib/sbcl/contrib/asdf" \ + --eval '(require :asdf)' \ --eval '(push (truename "./") asdf:*central-registry*)' \ --eval '(require :cl-rw-demo-${demo})' \ --eval '(rw.demo.${demo}::save-image)' ''; cclBuild = '' lx86cl64 -K utf-8 -n \ - -l "${ccl}/share/ccl-installation/tools/asdf" \ + -e '(require :asdf)' \ -e '(push (truename "./") asdf:*central-registry*)' \ -e '(require :cl-rw-demo-${demo})' \ -e '(rw.demo.${demo}::save-image)' ''; + cmuclBuild = '' + lisp \ + -batch \ + -noinit \ + -nositeinit \ + -eval '(require :asdf)' \ + -eval '(push (truename "./") asdf:*central-registry*)' \ + -eval '(require :cl-rw-demo-${demo})' \ + -eval '(rw.demo.${demo}::save-image)' + ''; + clispBuild = '' + clisp \ + -v \ + -norc \ + -i "${clisp}/lib/clisp/asdf" \ + -x '(push (truename "./") asdf:*central-registry*)' \ + -x '(require :cl-rw-demo-${demo})' \ + -x '(rw.demo.${demo}::save-image)' + ''; eclBuild = '' ecl \ -norc \ - -load "${ccl}/share/ccl-installation/tools/asdf" \ + -eval '(require :asdf)' \ -eval '(push (truename "./") asdf:*central-registry*)' \ -eval '(require :cl-rw-demo-${demo})' \ -eval '(rw.demo.${demo}::save-image)' @@ -41,7 +66,7 @@ stdenv.mkDerivation rec { mkclBuild = '' mkcl \ -norc \ - -load "${ccl}/share/ccl-installation/tools/asdf" \ + -eval '(require :asdf)' \ -eval '(push (truename "./") asdf:*central-registry*)' \ -eval '(require :cl-rw-demo-${demo})' \ -eval '(rw.demo.${demo}::save-image)' @@ -51,6 +76,8 @@ stdenv.mkDerivation rec { '' + (if "sbcl" == "${lisptype}" then sbclBuild else if "ccl" == "${lisptype}" then cclBuild + else if "cmucl" == "${lisptype}" then cmuclBuild + else if "clisp" == "${lisptype}" then clispBuild else if "ecl" == "${lisptype}" then eclBuild else if "mkcl" == "${lisptype}" then mkclBuild else ""); diff --git a/demo-zappel.lisp b/demo-zappel.lisp @@ -195,6 +195,18 @@ (defun save-image () #-(or ccl cmucl sbcl) (error "TODO RW.DEMO.ZAPPEL::SAVE-IMAGE") + #+clisp + (ext:saveinitmem "cl-rw-demo-zappel" + :executable t + :quiet t + :norc + :init-function (lambda () + (handler-case + (progn + (start) + (loop (sleep 1))) + (condition () + (quit 1))))) #+ccl ;; TODO no debug on ^C (ccl:save-application "cl-rw-demo-zappel" :prepend-kernel t diff --git a/release.nix b/release.nix @@ -4,10 +4,15 @@ let in { cl-rw-demo-counter-sbcl = demo "counter" "sbcl"; cl-rw-demo-counter-ccl = demo "counter" "ccl"; + cl-rw-demo-counter-cmucl = demo "counter" "cmucl"; + cl-rw-demo-counter-clisp = demo "counter" "clisp"; #cl-rw-demo-counter-ecl = demo "counter" "ecl"; #cl-rw-demo-counter-mkcl = demo "counter" "mkcl"; + cl-rw-demo-zappel-sbcl = demo "zappel" "sbcl"; cl-rw-demo-zappel-ccl = demo "zappel" "ccl"; + cl-rw-demo-zappel-cmucl = demo "zappel" "cmucl"; + cl-rw-demo-zappel-clisp = demo "zappel" "clisp"; #cl-rw-demo-zappel-ecl = demo "zappel" "ecl"; #cl-rw-demo-zappel-mkcl = demo "zappel" "mkcl"; }