Hat bugs, wishes and comments noted during Cambridge trip 30-31 May ------------------------------------------------------------------ BUGS: * trace: currently the parent of the tested expression in an if/case/guard is the context of the if/case/guard. It probably should be the if/case/guard itself (example: in Insort parent of 'o' <= 'a'). * hat-trail: if it was invoked from another tool, then pressing backspace at the top of the window quits hat-trail. This can easily happen accidentally and hence should not be possible. * hat-trail: output pane overflows for some large outputs, e.g. an infinite list of a's. * hat-trans/hmake: do not work for literal programs. * hat-trans/hmake: do not deal with cpp commands (#define...) * hat-trans: does not support (..) in im/export lists * hat-trans: produces error "AuxFile line 390 case with unmatched pattern". Only for erroneous input files, but very bad error message. * source windows: can easily be closed accidentally by pressing any key. * hat-observe: observed constructors still have RHS, e.g. Soln ... = Soln ... * Display like 3:[] makes it hard to recognise a singleton list. Currently lists within lists seem to be always displayed with cons and nil (example: wheel). * Display of list with cut-off elements and of list with cut off tail are indistinguishable. * Hat-trans: trusting FiniteMap we can see the top Branch of a tree FM, but all its arguments are hidden. Unfortunately seems to be consequence of implementation of trusting. To produce the outer constructor the inner constructors need to have already been evaluated. * hat-trans: mkApp15, fun10, etc. missing. * hat-trans: export of field label does not export selector (only bfield, not gfield). * hat-trans: parser interprets {# line 234 -} annotations and thus source window shows wrong positions. Maybe tools should actually show original source? * hat-trans: f 1 True = ... called with `f 4 undefined' pattern matches on True! * hat-trans: "hat.c: unimplementedError: does not exist" * in Happy observed: _ ++ "..." = "...." WISHES: * user specified display of data structures (esp. trees) * hat-observe: extended query language (variables with constraints, in*) * The tools should not display _|_, but always the more informative error message, e.g. error "pattern match failure". spj had quite strong feelings on this. * A tool for truncating the trace when the computation was interrupted too late and lots of confusing output has been produced. * Hat-trail: an option to go to "the end of the recursion" in an interrupted infinite loop. * Creation of a new trace invalidates all tool windows; any way to detect this and close the tool windows? * hat-observe: sometimes only interested in particular arguments of a function (e.g. search in last piece). Would like to see the argument in great depth and hardly see anything of other arguments and results. * hat-observe: option to count the number of certain observations, e.g. how often is `search (4,5)' called? * hat-trail: dynamically trust a module / a given function variable. * Can pretty printing of nested expressions be improved to see the nesting better? * spj would like to call a Haskell interpreter from the tools with a marked expression passed automatically; unevaluated parts could be just "undefined" or replaced by a given expression. Would be a simple way to obtain user specified display. * Combine Hat with an interpreter, such that the evaluation of any entered expression can be traced. On finding a suspicious computation of a function with large arguments in the trace the user would like to trace this function with a smaller argument. * hat-trail: option :o functionvar should work. * Strongly want access to untransformed libraries! - types may be kept abstract, e.g. {FiniteMap} - overloading may be resolved by using instance Ord T => TOrd T and instance Ord a => Ord (R a) ? * A viewer for free navigation through the trace (forward and backward). COMMENTS: * quite hard for S&S to understand meaning of parent, to see that parent and result are not inverses (stress this point in tutorial?) * hat-trail: The :o option does *not* observe the marked expression, if it is an application; then the function of the application is observed. This is irritating; one might expect the marked expression to be the observed *pattern*. * Tracing costs too much time. * The original last-piece program of spj ran for too long for tracing. Advice users to cut down computation; however no natural smaller variant for this program. * hat-trail: spj first wasn't aware that there is a message displayed between the two panes. * irritating that cafs don't have source positions and don't have parents; need advice in user manual on how to reach potential parents (:set all and trail all observations) or additional tool support. * hat-trail: the |'s in front of if and case are irritating. The concept of these control operators hard to grasp. * Many source windows irritating. Maybe reuse old ones? * It is often difficult to determine if a self-tracing program is only slow or if it loops. Need advice. Maybe some kind of reduction / time counter could be shown? * Selecting a subexpression with the keyboard is hard and nonintuitive. * Often user is interested in the size of a data structure (length of list), but not its elements. * spj sceptical about tracing ghc. (hard to transform, hard to view; useful?) MAIN TOPICS: Performance (time+space) (at compile/run/tracing time) - foreign import *unsafe* - need explicit {- inline -}s - try to make second argument of R unboxed, possibly using mkR. Or: data R a = R a !T data T = Lazy Int | Strict Int# - fseek seems to require synchronisation and hence disturb buffering. Hence Hat library should use own buffering. Scope Type system extensions should be easy to implement. Multi-parameter classes are used a lot. The IOExts library is used a lot (IORefs, unsafePerformIO). The ST library is used a lot. Choose between wrapping (abstract) or lifting of types? Aforementioned wrapping of untransformed libraries would considerably increase the scope of Hat. Packaging Have self-tracing copy of library tree in tools/Hat or Hat. The same subdirectory structure should be used in the local program directory to simplify prefixing with directories. The library tree only needs to contain *.hi, *.hx, *.o, *.a. Need guidance in the user manual on how to install a package, that is a subset of the library tree for which source code is available. Quality Use catch from the Exception library to catch nearly any exception. GHC has hook in runtime system for catching heap overflows.