Feature request: REPL mode for debugging

Wouldn’t it be great to have a REPL mode that’s optimised for debugging rather than ultimate performance? Or maybe it has some experimental features that can be turned on at the user’s own risk? Some features that might be useful when debugging at the cost of some potential performance loss:

  • Avoid optimising IO code for faster printing
  • Method selection and type inference while the user is typing the commands! For example if I am typing println(x) and x is a vector of floats, before typing ) and enter, Julia can probably tentatively select the method and partially compile it shaving off some perceived compile-time. This feature can also be useful when running a long script line by line where the whole file can be analysed and compiled behind the scene while running one line at a time.
  • Error upon dynamic dispatch. This can be useful for debugging type inference issues.
  • Error upon allocations. This can be useful while debugging allocations.

Curious to know what folks here think or if you want to add to this list.

14 Likes

bump

It’s an interesting idea. I guess someone has to decide to try implementing it.

4 Likes

Regarding the second point, Rust seems to be doing something similar where it’s figuring out the types of the variables on the fly as you are coding. This is how I got this idea actually. It also has a “debug” compilation mode which is where I got the whole idea from :slight_smile:

1 Like