guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thoughts on ports


From: Ludovic Courtès
Subject: Re: thoughts on ports
Date: Wed, 11 Apr 2012 00:11:46 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hello!

Andy Wingo <address@hidden> 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) to be
> Scheme bytevectors, and internally store offsets instead of pointers.
> Give access to some internal port primitives to a new (ice-9 ports)
> module.
>
> I think we can manage to make (ice-9 ports) operate in both binary and
> textual modes without a problem, just as we do with cports.  We'll have
> to expose some iconv primitives to (ice-9 ports), but that's just as
> well.  (Perhaps we should supply an (ice-9 iconv) module ?)

I like the idea (more Scheme!).  However, it’s not clear to me what the
performance impact would be with Guile’s current state.

For instance, while ‘read’ remains in C, it can only suffer from such a
change.  Conversely, things like ‘get-u8’ and ‘get-bytevector-n!’ may be
faster.  OTOH, the equivalent of ‘get_utf8_codepoint’ is likely to be
much slower.  And we still need to call out to C for ‘iconv’ and
libunistring.

My 2¢,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]