Re: thoughts on ports

2013-01-20 Thread Ludovic Courtès
Andy Wingo skribis: > The goal was to be able to provide Scheme functions that operate on > ports, but that can suspend the operation via an abort-to-prompt if it > will block. This can only be done if we are not recursing through C. > Exposing the fundamental buffers lets port operations to be

Re: thoughts on ports

2013-01-20 Thread Andy Wingo
On Fri 18 Jan 2013 22:27, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> As a thought experiment, I don't see why things should have to slow >> down. Master has `scm_c_take_gc_bytevector', which can be used to wrap >> the existing scm_t_port::write_buf, ::read_buf, and ::putba

Re: thoughts on ports

2013-01-18 Thread Ludovic Courtès
Hi! Andy Wingo skribis: > As a thought experiment, I don't see why things should have to slow > down. Master has `scm_c_take_gc_bytevector', which can be used to wrap > the existing scm_t_port::write_buf, ::read_buf, and ::putback_buf > members. At the cost of three allocations per port and th

Re: thoughts on ports

2013-01-17 Thread Andy Wingo
Hi, Again, picking up old things: On Wed 11 Apr 2012 00:11, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> Obviously we need ports implemented in C because of bootstrapping >> concerns. But can we give Scheme access to buffering and the underlying >> fill (read) / drain (wri

Re: thoughts on ports

2012-04-11 Thread Mark H Weaver
Hi Andy, Andy Wingo writes: > I have been thinking about ports recently. I know other folks have had > some thoughts here too, so it's probably good to have a discussion about > how they should look. I apologize that I've not yet had time to properly look into your eports work, so I'm afraid th

Re: thoughts on ports

2012-04-10 Thread Ludovic Courtès
Hello! Andy Wingo skribis: > Obviously we need ports implemented in C because of bootstrapping > concerns. But can we give Scheme access to buffering and the underlying > fill (read) / drain (write) / wait (select) operations? > > So, the idea: refactor the port buffers (read, write, putback) t

Re: thoughts on ports

2012-04-09 Thread Noah Lavine
Hello, On Mon, Apr 9, 2012 at 3:15 PM, Mike Gran wrote: > Anyway, here's an idea.  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 base ports

Re: thoughts on ports

2012-04-09 Thread Mike Gran
> From: Andy Wingo >   >Hi all, > >I have been thinking about ports recently.  I know other folks have had >some thoughts here too, so it's probably good to have a discussion about >how they should look. ...   >Obviously we need ports implemented in C because of bootstrapping >concerns.  But can