[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Enable truncation of exception output
From: |
Andy Wingo |
Subject: |
Re: Enable truncation of exception output |
Date: |
Fri, 10 Mar 2017 10:17:24 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi :)
On Fri 10 Mar 2017 10:07, address@hidden (Ludovic Courtès) writes:
> I’d be in favor of something more conservative, notably because
> ‘simple-format’ remains faster than ‘format’:
Ah indeed. simple-format does appear to be much faster.
Tested using:
(define-syntax-rule (do-times count exp) (let lp ((n 0)) (when (< n count)
exp (lp (1+ n)))))
,time (string-length (call-with-output-string (lambda (p) (do-times #e1e4
(format p "foo")))))
and for simple-format too, and when adding a ~a.
Clearly the answer here is to work on improving the performance of
"format" :)
> 1. Remove ‘set!’ in (ice-9 format), which has always been a bad idea.
This is *not* conservative. We would certainly break users' code with
this. I know there's -Wformat but still :)
> 2. For exception printers, use some autoload magic, just like we do
> for the debugger.
This is hard for boot reasons -- you might get an exception before you
are able to load modules. Of course this doesn't happen in the normal
case but it would make Guile hacking a bit harder. Still, perhaps it is
possible.
Andy