From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: anyone define port types? Date: Thu, 23 Jun 2016 09:36:48 +0200 Message-ID: <8760t0qru7.fsf@pobox.com> References: <87y492mnjp.fsf@pobox.com> <87pots9tag.fsf@gnu.org> <87bn37wtf2.fsf@pobox.com> <20160612092513.3eb1c8a3@laptop.homenet> <8760t5mthu.fsf@pobox.com> <20160619163327.36246706@dell.homenet> <8737o9kr3g.fsf@pobox.com> <20160619210912.48528ffa@dell.homenet> <20160620074503.6d06426b@dell.homenet> <87y460jou5.fsf@pobox.com> <20160620100157.530fc347@dell.homenet> <20160622234450.773f313f@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466667502 30287 80.91.229.3 (23 Jun 2016 07:38:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 07:38:22 +0000 (UTC) Cc: guile-user , guile-devel To: Chris Vine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 23 09:38:09 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFzD9-0004yZ-Rn for guile-devel@m.gmane.org; Thu, 23 Jun 2016 09:38:03 +0200 Original-Received: from localhost ([::1]:34953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzD9-0005Cy-30 for guile-devel@m.gmane.org; Thu, 23 Jun 2016 03:38:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzCC-0004hq-90 for guile-devel@gnu.org; Thu, 23 Jun 2016 03:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFzC6-00033A-BI for guile-devel@gnu.org; Thu, 23 Jun 2016 03:37:03 -0400 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:57951 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzC6-00032t-4u; Thu, 23 Jun 2016 03:36:58 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id C9EB81E8DE; Thu, 23 Jun 2016 03:36:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=pqNylzHUxw2xjjVB6R2E/JSQhUs=; b=iW5I66 HKjthNFXWHSKcwktJx+aGSSFppQHXX7hdHRpPdFWFEeOl+5440s/x/cjUY6AjDgh s13ZpbVrLsHY3GYdqve5wl8Y+NeLDB/iD1isXVLX1c0HooVlxjV8dlLpmT3ZWU82 S3oQpmJo4sI6HyQd66Rml8wPInoum9DL3oUYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=XsDfFEZmGcSjNIkJkKWdsy9OCDC+iqXM rD/cL9UvRv3qkMMzOoGlFuejrwV27syTyr6y5Pah5/EX4o9XFzzqkZNsCOpZfju2 IdNhEcNhLDXjsuVIjbmDgBZHEm3xv237fhF4jcn9VklbSvmdGbsfGcDCFbSnWLRU q+5AoNDSCb4= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id C14641E8DD; Thu, 23 Jun 2016 03:36:56 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id DCA841E8DC; Thu, 23 Jun 2016 03:36:55 -0400 (EDT) In-Reply-To: <20160622234450.773f313f@bother.homenet> (Chris Vine's message of "Wed, 22 Jun 2016 23:44:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 42F6208E-3915-11E6-81C1-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.67 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18393 gmane.lisp.guile.user:12688 Archived-At: On Thu 23 Jun 2016 00:44, Chris Vine writes: > I have stirred myself and installed guile-2.1.3. On looking more at > the suspendable ports code it became obvious and I haven't needed to > adopt anything like ethreads with its "thread" abstraction: instead I > have kept the approach already adopted in the guile-a-sync library. Excellent. Though I think that eventually we will want to bless one of these concurrency patterns as the default one, we're a long way away from that, and even if we do bless one I think we will always want to allow people to experiment and deploy different ones. So, great, glad to hear you are doing work in this area :) > However, the consequence of using suspendable ports instead of C ports > is that the await-getline! procedure (as an example) has been reduced > to a mere 16 lines of code, mainly because it is possible to use (ice-9 > rdelim)'s read-line procedure with non-blocking ports. Excellent! That's the result I was hoping for. > I have made a new repository for guile-a-sync for use with guile-2.2 and > when I am happy with the new interfaces (and assuming nothing else goes > wrong) I will put it up on github. > > This is very nice. Thanks for taking the time to go through it with me. Thank you for your patience too! The only drawback that I know of with the strategy of simply allowing users to use Guile's I/O primitives (e.g., `read-line') and assuming that they'll suspend when they block is that not all of the primitives that you would like to you have been rebased on top of the ones implemented by (ice-9 suspendable-ports). So if you find such an I/O procedure that needs to be rewritten to use put-string instead of display, for example, then please do send a patch. As for `display' and `write'... I guess we can at least make suspendable ports handle these in a non-blocking way for some limited number of data types like strings, characters, and symbols, and dispatch to the C `display' implementation for more complicated data types like SMOBs or so. We'll see I guess. Happy hacking, Andy