From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: thoughts on ports Date: Mon, 9 Apr 2012 16:21:29 -0400 Message-ID: References: <87zkam7z5n.fsf@pobox.com> <1333998931.14174.YahooMailNeo@web37907.mail.mud.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1334002898 13117 80.91.229.3 (9 Apr 2012 20:21:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2012 20:21:38 +0000 (UTC) Cc: Andy Wingo , guile-devel To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 09 22:21:37 2012 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 1SHL5l-0003zu-8U for guile-devel@m.gmane.org; Mon, 09 Apr 2012 22:21:37 +0200 Original-Received: from localhost ([::1]:54151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHL5k-0001CY-Fz for guile-devel@m.gmane.org; Mon, 09 Apr 2012 16:21:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHL5h-0001CO-Pt for guile-devel@gnu.org; Mon, 09 Apr 2012 16:21:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHL5f-0003vR-RO for guile-devel@gnu.org; Mon, 09 Apr 2012 16:21:33 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:39133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHL5f-0003vE-JP for guile-devel@gnu.org; Mon, 09 Apr 2012 16:21:31 -0400 Original-Received: by iajr24 with SMTP id r24so7885621iaj.0 for ; Mon, 09 Apr 2012 13:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Dd4KB+82AwKxuXpyq6WdW7gZaiBWjbJR5w+QyVfBIbg=; b=K2x03wYCor5lRfAD6dtrw/nJN6VfnOm8wz2wMZUfz0DAbGiyJ8xKVt6rrANIt1QLnt WQg1yb4m4CpY0vahH22HAG6uuE0LczL8BeaTICSotNa0cjg7h8h0Bi7QoPCYftkAk+vc 8paP61FRAlpEwfZEX5jBMIkawXg588BEnmaLjMXlbGPs9B2crC8+KBhpRjQal4gkrj3r CE5MKc9XkHXvI9ZUKfeYM3//MRc97P+EgVWj/u2vF62y3bAT4/UYOa7gGDrTi9xjf1Ty YxSWrfg2S8TBHN+Wmc/3zsosyRxaWzthUKfpre51k2t8KLJfJGm/djHdegTSUaAPRI54 TR6A== Original-Received: by 10.50.192.228 with SMTP id hj4mr193614igc.65.1334002889133; Mon, 09 Apr 2012 13:21:29 -0700 (PDT) Original-Received: by 10.42.29.200 with HTTP; Mon, 9 Apr 2012 13:21:29 -0700 (PDT) In-Reply-To: <1333998931.14174.YahooMailNeo@web37907.mail.mud.yahoo.com> X-Google-Sender-Auth: gwzT-rEOJryhpDt_-N95EcnX44M X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14237 Archived-At: Hello, On Mon, Apr 9, 2012 at 3:15 PM, Mike Gran wrote: > Anyway, here's an idea.=A0 Let's call the C code for ports 'base ports'. > > 1. Refactor the C reader so that it took on the responsibility of > storing the putbacked (ungotton?) characters. > > 2. This would let you simplify the=A0base ports to make read, write, > and unget into those operations that the underlying device could > provide.=A0=A0During bootstrap, a=A0read-only=A0base file port would erro= r on > unget, for example.=A0 Base ports would not longer have pushback buffers. > There would be no such thing as string base ports since they aren't > a device. > > 3. Then you could get through bootstrap and create scheme ports on top > of the base port primitives. Would it be possible to make this simpler (at least for now) by changing steps 1 and 2 as follows? 1. Refactor ports code so read, write, unget are separate operations with Scheme interfaces (where supported). 2. Define the standard Scheme port type in C, using the read/write/unget primitives, so that the C reader can use it during startup That gives you the flexibility of having the primitives around, but lets you avoid the rewrite of the C reader. Noah