Type checker user interface and error reporting

31 views
Skip to first unread message

nha...@gmail.com

unread,
Mar 28, 2022, 2:32:07 PM3/28/22
to Shen
Displaying helpful type errors with Shen's type system seems quite difficult due to the way the system works. I wonder how useful in practice it would be to generate a heat map colorized with the number of times a particular sub-expression failed to unify during type checking and have it fed back into the IDE. This may also indirectly help show which type rules cause excessive backtracking.

Mark Tarver

unread,
Mar 29, 2022, 8:14:31 AM3/29/22
to Shen
Type checking in Shen is nondeterministic and the problems of modelling the computation for humans is akin to the problem of creating a good Prolog trace 
package.  The heatmap idea is good; you can try

(datatype heatmap

  let Heatmap (heatmap P)
  if false;
  _________________________
  P;)

(define heatmap
   P -> (set *heatmap* [P | (value *heatmap*)]))

as a catch-all default rule and see what you catch.

Mark

Reply all
Reply to author
Forward
0 new messages