unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: "Linus Björnstam" <linus.internet@fastmail.se>
Cc: guile-user@gnu.org
Subject: Re: Srfi-159/166 - monadic formatting for guile
Date: Tue, 11 Jun 2019 18:01:27 -0400	[thread overview]
Message-ID: <87pnnj7pd9.fsf@netris.org> (raw)
In-Reply-To: <d57a1e01-3db2-46bc-bf56-e9ab7fa76422@www.fastmail.com> ("Linus \=\?utf-8\?Q\?Bj\=C3\=B6rnstam\=22's\?\= message of "Sun, 02 Jun 2019 15:38:50 +0200")

Hi Linus,

Linus Björnstam <linus.internet@fastmail.se> writes:

> I just ported the reference implementation of SRFI-159/166 (166 being
> the successor of 159) from the reference implementation in chibi
> scheme. The srfi document is here:
> https://srfi.schemers.org/srfi-166/srfi-166.html
>
> SRFI-166 is like (ice-9 format) on steroids, drenched in molasses. It
> can do a lot more than (ice-9 format), but about 3x slower. I haven't
> started trying to make it fast just yet, but there are some low
> hanging fruit (like speeding up simple cases). I will wait with
> optimization until the srfi is finalized (and also maybe hear with
> Alex what he has in mind before trying to half-ass it myself).
>
> Anyway, the repo is here: https://bitbucket.org/bjoli/guile-srfi-159
> . I haven't ported the tests, but playing with it in guile and chibi
> scheme produces the same result. Tests are up, but I'm travelling
> without computer the next week, so there is no time.

I would be in favor of integrating this into Guile at some point,
although first I would like to make a careful review of the
implementation to make sure that it integrates well with Guile's related
mechanisms, e.g. custom record printers, printer options, and print
states, and that it supports all Guile data types.  In particular, I
remember finding it difficult to properly implement cycle detection
while supporting Guile's existing mechanisms.  I'm not sure it can be
done without modifying Guile's built-in printer.

I'll also want to take a close look at the numeric formatter, to make
sure that it achieves the same properties as our built-in printer,
e.g. that it prints inexacts with the minimal number of digits required
to ensure that the same number will be read back in (unless specifically
asked to limit the precision).

Anyway, thanks very much for sharing this!

    Regards,
      Mark



  parent reply	other threads:[~2019-06-11 22:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02 13:38 Srfi-159/166 - monadic formatting for guile Linus Björnstam
2019-06-02 20:31 ` Arne Babenhauserheide
2019-06-02 20:41 ` Ludovic Courtès
2019-06-03  5:34   ` Linus Björnstam
2019-06-03 13:07     ` Ludovic Courtès
2019-06-11 22:01 ` Mark H Weaver [this message]
2019-06-14  9:38   ` Linus Björnstam
2019-06-16  6:35     ` Mark H Weaver
2019-06-16 16:20       ` John Cowan
2019-06-16 19:30         ` Mark H Weaver
2019-06-18 10:39           ` Linus Björnstam
2019-06-16 20:30       ` Linus Björnstam

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=87pnnj7pd9.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guile-user@gnu.org \
    --cc=linus.internet@fastmail.se \
    /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).