THE COLLECTED LIST OF HAT BUGS AND WISHES ART Memo 40, Version 0 Colin Runciman, 5 March 2003 This memo is based on notes from June 2002 that were previously allocated already-taken memo numbers -- a bug, and I wished to combine them anyway! Some of the bugs and wishes listed here are now fixed or fulfilled, and more recently realised bugs and wishes may not be listed. As changes in the bug-wish state will continue to occur, there are likely to be amended versions of the memo. BUGS 1. hat-trans does not handle source programs with (..) in export or import lists 2. hat-trans output fails to compile if the source program depends on defaults to resolve numeric types 3. hat-trans suffers a pattern-match failure if the source program has a pattern including an out-of-scope constructor 4. hat-trans can transform pattern bindings with newtype data constructors incorrectly, duplicating variable definitions 5. hat-trans outputs can fail at link or run time if the arity of source definitions or applications is large 6. hat-trans outputs do not export selectors for field labels 7. data constructions in a trusted context are hidden if they are evaluated before they are demanded in an untrusted context 8. the grandparent of the subject expression in an if/case/guard is recorded as its parent NOT A BUG: the recorded parent is as intended 9. evaluations of comprehensions, do-expressions and arithmetic sequences are recorded and displayed as unsugared applications that do not occur in the source program 10. viewing tools display some lists misleadingly: when the tail of a sugared list is cut off or undefined it is shown as if it was a final element 11. hat-observe inappropriately lists trusted CAFs under :info and allows observations of CAF values that should be hidden 12. hat-observe :info counts may not match the number of observations if there are partial or super-saturated applications (example program: MixArity) 13. hat-observe may incorrectly show applications as distinct when arguments include a cyclic structure 14. hat-trail display can become corrupted if output or error message from the traced program exceeds a few lines 15. hat-trail display can become corrupted if trail expressions or equations are large enough to require scrolling 16. ^C in a hat-observe window (to cut short a search) can shut down a hat-trail window spawned from the same hat-observe session 17. after :set recursive off hat-observe shows the non-recursive calls of f even if given the application pattern "f in f" (example program: ObsRec) 18. hat-observe reports no match found given an application pattern ... in c where c has a 0-arity definition even if matching applications do occur in c (example program: ObsInCaf) LITTLE WISHES 1. backspace to correct slips in : command-lines 2. separate cutoff length for strings from general cutoff depth 3. advice for users wishing to use hat but not hmake 4. in hat-trail :o [application-pattern] should work 5. in hat-observe :o [application-pattern] => new window not wizard! 6. in hat-observe support :i [module-name] -- if no module specified, split listing into sections headed by module name 7. in hat-observe allow variables in application patterns to be qualifed by module name 8. in hat-observe :I to list recorded constructor applications 9. in hat-observe an option to suppress display of results 10. in hat-observe allow application patterns after "in" 11. in hat-observe an option to show the number of instances of each uniquely represented application 12. in hat-observe bring back % progress indicators 13. in any viewing tool accept :S [qualified] name 14. scrolling and resizing of source windows (with line numbers instead of fixed source reference line) 15. viewing tools compare time-stamps of trace files with those of sources and issue warning if appropriate 16. get priority info from .hat file to avoid need for extra brackets when infix operators are used (eg in application patterns) 17. notation: replace (_IO_) by {IO}; replace {_} by {?} BIGGER WISHES 1. combine traced and untraced modules by a more drastic wrapping (eg. data structures of type T computed within the wrapped module recorded as {T}) and subclassing to get around mismatch of method types (eg. Ord T => TOrd T and Ord a => Ord (R a)) 2. support tracing of locally defined functions by recording bindings for free variables (eg. add refs to static parent names in local name nodes and extend local argument lists to include free variables defined within top-level parent with the name entries for these variables) 3. with or without 2, hat-observe to support observation of locally defined functions or data values if :set locals on. Locals to be listed by :i (indented below their parents?) and observations of locals to be split into same-instance groups (headed by whatever contextual bindings for variables are available) 4. extensional observation by hat-observe of a (\..) selected in hat-trail (important to ensure that all observations are of exactly this function not just a function with same source) 5. evaluation windows with bindings to selected expressions from trace viewers (quite easy for expressions that only contain top-level function names and/or fully evaluated data; anything else poses representation problems) 6. hat-trail to list the sequence of IO actions, not just text output to stdout 7. further decompose textual output into pieces connected by ++ 8. hat-trail to support multiple steps along trails Eg: - to nearest ancestral application of any top-level function - to nearest ancestral application of a named function - to nearest non-recursive ditto 9. hat-trail to support single-step forward reduction from a redex (perhaps shown as indented lines starting ->) 10. option to assert trust in named modules or top-level functions in all trace-viewing tools 11. hat-detect for new-format traces including correct handling of untrusted computation in a trusted context and an option to show all children of current EDT node 12. generalise hat-observe to hat-query, with a user-programmable query language for more general and powerful access to the hat trace than current commands 13. user-programmable display of expressions in textual or graphical form 14. hat-observe option to see arguments and results of trusted (and perhaps other) functions that have 0-arity definitions 15. a coordinating environment for tracing that, for example, automatically closes trace windows when program is modified and/or run again 16. a tool that cleanly truncates a trace file as if the computation had been interrupted at some specified break-point 17. more support in hat-trail for tracing parent uses of zero-arity definitions and their source locations 18. run-time options to report the number of reductions (or other computational steps) in an untraced computation and to report corresponding numbers (or better still, a % indicator) at intervals during a traced computation 19. make source windows active, for example allowing selection of an application or function for observation in hat-observe 20. editable command lines with readline functionality 21. special-purpose tool to locate black-holes in traces 22. add an evaluation bit to projection/forward nodes allowing {_}/{?} to be displayed as _ where appropriate CONTROVERSIAL WISHES 1. option to show lambda expressions in full 2. a graphical user interface for hat viewers 3. always display error "... message ..." if available, not _|_ 4. a Free Navigation viewer 5. support for tracing stateful monadic computations in terms of sequences of states 6. option to use unification instead of one-way matching with application patterns in hat-observe 7. :o in hat-trail to use the currently selected expression as the implicit application pattern to observe