# Feature request: REPL mode for debugging

**URL:** <https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926>\
**Category:** Internals & Design\
**Tags:** discussion\
**Created:** [August 24, 2021, 4:57pm UTC](https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926 "2021-08-24T16:57:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [August 24, 2021, 4:57pm UTC](https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926/1 "2021-08-24T16:57:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [August 28, 2021, 4:15am UTC](https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926/2 "2021-08-28T04:15:38Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [August 28, 2021, 6:35pm UTC](https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926/3 "2021-08-28T18:35:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [August 28, 2021, 6:38pm UTC](https://discourse.julialang.org/t/feature-request-repl-mode-for-debugging/66926/4 "2021-08-28T18:38:48Z")

</div>

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 🙂
