#Can Mojo support hot reload in debugging session?

4 messages · Page 1 of 1 (latest)

austere bear
#

Just curiosity. Is this possible to replace code on the fly?

heavy marlinBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

cobalt wolf
#

Hot reload in languages with static typing tends to get very messy very quickly. When they are native compiled it gets even worse since the language has to deal with differences in type layout.

The good news is that Mojo can run in a JIT mode where it doesn't try to optimize very hard (the repl), and what was historically the slowest part of LLVM (the optimizer) is mostly bypassed by Mojo. As a result, it should be reasonable to rerun the entire program to see your changes. This introduces some friction for GUI projects, but having another thread which gets through the GUI to the place you want to test is always an option while working in a particular area.

Modular may be able to pull something off, but hot reload is primarily useful for two things:

  1. GUI development.
  2. Extremely long running distributed systems (think a single process running for 5 years with hot reloads being used to prevent downtime).

Option 2 is something that a language has to be designed for from the start.

sacred moss