Live data from Hacker News

Reloadr – Hot code reloading tool for Python

github.com

51–58 of 58 posts

Re: Reloadr – Hot code reloading tool for Python

#51

That's a bit awkward, I'm currently working on a package[1] that does more or less the same thing in more or less the same way (I think), except you don't need to decorate anything. Just run `python -m jurigged script.py` or `jurigged script.py` instead of `python script.py` and it will watch everything in the current working directory. There's still some bugs I have to iron out, though, it should be better in a mont…

Have you looked at `hupper` from the Pylons Project? The author posted here: https://news.ycombinator.com/item?id=26039366

why is such feature of reloading needed in the first place? I am a beginner

thanks

Re: Reloadr – Hot code reloading tool for Python

#52
post #51

Earlier quoted context omitted.

Have you looked at `hupper` from the Pylons Project? The author posted here: https://news.ycombinator.com/item?id=26039366

why is such feature of reloading needed in the first place? I am a beginner thanks

Accellerates the dev process by removing a whole bunch of steps: terminating the running program, relaunching the running program, repeating any steps to get back to the code in question.

While these things only take maybe a few seconds each, thats a few seconds that you’ll perform maybe hundreds of times. Reducing context switches is always a good thing.

Re: Reloadr – Hot code reloading tool for Python

#53

I stumbled upon this because there seems to be a FOSDEM talk which talks about it: https://fosdem.org/2021/schedule/event/python_reloading/ ( https://news.ycombinator.com/item?id=26034851 ) I wonder if this is used seriously by someone. I always thought that this has a potential to greatly improve the development productivity. I remember I saw live coding videos from Notch (Minecraft) on some gamejam where he intensi…

This man is a genius.

Re: Reloadr – Hot code reloading tool for Python

#54
post #3

What are some simple use cases for this?

Not a user of Reloadr, but hot code reloading is a big thing on my Java development process. There are servers and use cases that take a long time to start or setup, and having the possibility to debug -> edit code -> re-execute a specific method using the same context goes a long way. For production usage, maybe that wouldn't be considered safe, but there are companies that provide services with this purpose (e.g. J…

JRebel literally saved our ** years ago. Compile, restart cycles would have killed us, with JRebel we were able to stay in the zone and iterate way way faster. The difference between rage quitting and going home at 430.

Re: Reloadr – Hot code reloading tool for Python

#55
post #41
post #25

For reloading from within the repl from importlib import reload as r Then in the ipython shell you can type r(module) to reload the entire thing. So I'll often have the editor in one terminal window, and ipython in the other one, save the code and switch back the repl, and type r(t) import mymodule as t Now tie in some ipdb [1] and you have a pretty sweet setup. Also depending on your serving framework it might also…

Why not just use ipython's built-in autoreload? https://ipython.readthedocs.io/en/stable/config/extensions/a...

This is pretty neat.

Re: Reloadr – Hot code reloading tool for Python

#56

Cool feature. Visual Studio seems to have "edit and continue" which I only knew from VB, but seems to be available in C# and C++ too. Not the same, but it shortens the development cycle in a similar fashion. The feature in Python reminds me on hot code loading in Erlang which I found quite interesting when i first read (never used) about the feature. I wondered which other languages provides (or didn't) an equivalent…

Edit and continue in C# is like magic. Paired with ability to move the execution-pointer or unwind the stack and rerun the function you can write a whole algorithm without ever stopping the debugger. Oops - something went wrong, just change the code, reassign the variable in the watch-window and drag up the execution pointer to previous line. Really powerful!

If only more environments had similar tools. Once you've worked with this other tools feel rather primitive.

Re: Reloadr – Hot code reloading tool for Python

#57
Author here, thank you for all this feedback .

It's great to see I am not the only one interested in this way of coding. I will have a look at all the alternatives your posted about, let's get hot code reloading in Python awesome!

Join the conversation on FOSDEM's Matrix channel tomorrow to discuss the subject further: #python-python_reloading:fosdem.org

Re: Reloadr – Hot code reloading tool for Python

#58
post #51

Earlier quoted context omitted.

Have you looked at `hupper` from the Pylons Project? The author posted here: https://news.ycombinator.com/item?id=26039366

why is such feature of reloading needed in the first place? I am a beginner thanks

albertzeyer's example with Notch explains the issue pretty well:

When working on a video game, restarting the game every time you are tweaking the behaviour of an entity takes a lot of time. Hot code reloading while keeping the state of the game makes development much easier.

On the other hand, when the entire state is stored outside of the Python app (eg: a web app using a database), restarting the entire process and reloading the page is fast enough and more reliable.

Post reply on HN