From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: thoughts on ports
Date: Wed, 11 Apr 2012 00:11:46 +0200 [thread overview]
Message-ID: <87aa2jqlst.fsf@gnu.org> (raw)
In-Reply-To: 87zkam7z5n.fsf@pobox.com
Hello!
Andy Wingo <wingo@pobox.com> 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’.
next prev parent reply other threads:[~2012-04-10 22:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-08 20:21 thoughts on ports Andy Wingo
2012-04-09 19:15 ` Mike Gran
2012-04-09 20:21 ` Noah Lavine
2012-04-10 22:11 ` Ludovic Courtès [this message]
2013-01-17 14:40 ` Andy Wingo
2013-01-18 21:27 ` Ludovic Courtès
2013-01-20 20:21 ` Andy Wingo
2013-01-20 22:11 ` Ludovic Courtès
2012-04-11 18:36 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aa2jqlst.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).