# Hot Code Replacement/Hot Code Reload in Debugging

**URL:** <https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711>\
**Category:** Help & Support\
**Created:** [June 23, 2022, 6:28am UTC](https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711 "2022-06-23T06:28:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![acodervic](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/acodervic/32/1671_2.png) [@acodervic](https://forum.crystal-lang.org/u/acodervic)\
**Post date:** [June 23, 2022, 6:28am UTC](https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711/1 "2022-06-23T06:28:27Z")

</div>

Is there any good way to recompile and start the program without recompiling after modifying the code in debug?

like java hot code replace.  
Recompiling and launching is too time consuming and a nightmare！

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [June 23, 2022, 12:28pm UTC](https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711/2 "2022-06-23T12:28:44Z")

</div>

> [@acodervic](#):
>
> Is there any good way to recompile and start the program without recompiling after modifying the code

Not at the moment no. The program needs to be recompiled when you make changes, so there’s no way around that. Your best bet currently would be to use something like [nodemon - npm](https://www.npmjs.com/package/nodemon) to recompile/restart the program on changes. E.g.

`nodemon --exec crystal run --watch src src/foo.cr`

EDIT: Could try out [Crystal's interpreter – A very special holiday present - The Crystal Programming Language](https://crystal-lang.org/2021/12/29/crystal-i.html), as that should make the feedback loop a bit shorter, but it’s still fairly experimental.

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [June 23, 2022, 2:29pm UTC](https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711/3 "2022-06-23T14:29:15Z")

</div>

I use [GitHub - samueleaton/sentry: Build/Runs your crystal application, watches files, and rebuilds/restarts app on file changes](https://github.com/samueleaton/sentry), not too bad anyway. a little kemal web project, less than 5 seconds after save changes.

---

<div class="post-metadata">

**Author:** ![acodervic](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/acodervic/32/1671_2.png) [@acodervic](https://forum.crystal-lang.org/u/acodervic)\
**Post date:** [June 23, 2022, 2:53pm UTC](https://forum.crystal-lang.org/t/hot-code-replacement-hot-code-reload-in-debugging/4711/4 "2022-06-23T14:53:27Z")

</div>

That’s very helpful, this is what I want, the interpreter is really too efficient in the debugging phase, and developing programs without it is a nightmare
