Re: Some minor patches / E stack traces

Kevin Reid <kpreid-M/[email protected]> Fri, 26 Aug 2011 08:56:45 -0400
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
On Aug 26, 2011, at 6:55, Thomas Leonard wrote:

> On 2011-08-24 16:19, Kevin Reid wrote:
>> On Aug 24, 2011, at 10:17, Thomas Leonard wrote:
>>> http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/e14b3b40363499712b93680c09d0a730e6b48271
>>> Give a shorter stack-trace from ELoader if the source file is missing
>> 
>> Is this really worth the additional complexity of the code?
> 
> Maybe. I think that part of the problem is that E stack traces are hard 
> to read. There's a lot of information (which is useful), but it's hard 
> to scan by eye.

Mm. I've always found the leading symbols (@ . -) to be sufficient, but I agree colorizing is a reasonable improvement.

> There's a patch on my "hacks" branch that colours the stack traces:
> 
> http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/f3da8f91a5a4ce9aebb8d484780a98fde389de05
> 
> "." lines are highlighted in yellow and <file:...> references are 
> highlighted in green.
> 
> So, if you want to know *what* calls were made (including values), just 
> look at the yellow lines. If you want to to know the *types* involved, 
> look at the white text, and if you want to see source locations, look 
> for green text.

This seems not-unreasonable (even assuming ANSI, as it is the de facto standard), except for the part where we don't have information about whether the output is *to* a terminal. I would rather see this as a syntax-highlighter stage optionally provided by elang.cmd.makeAnswerer (or a different object with the same interface), so that it's closer to the UI layers and not baked into exception objects' protocol.

-- 
Kevin Reid                                  <http://switchb.org/kpreid/>