HNHacker News
TopNewBestAskShowJobs

kwazar90

160 karma · joined April 26, 2022

Creator of Reloadium - Hot reloader for Python https://github.com/reloadware/reloadium
submissionscomments
kwazar90··on Is it possible to detect AI generated text?
IMHO, short text - not really. Longer - depends on the model quality but basically longer it gets it's easier to see the LLM patterns.
kwazar90··on Reloadium – Advanced hot reloading for Python
From the original function call.

It basically restarts the current frame.

kwazar90··on Reloadium – Advanced hot reloading for Python
It's just me working on this project, and yeah I'm not super strong with marketing or business neither english is my first language.

Do you have any suggestions how to describe it better? Is "Edit and continue" more descriptive (I think this is what Microsoft calls it for .net).

kwazar90··on Reloadium – Advanced hot reloading for Python
Reloadium executes a module in a sandbox environment until it reaches the modules top most frame location (to prevent getting into a loop or other entrypoint and being stuck) and looks for changes.

For code that should be executed only once you have to add # reloadium: no_reload (blocks of code can be ignored as well, more details here https://reloadium.io/documentation/decorators)

kwazar90··on Reloadium – Advanced hot reloading for Python
It does print a message when something can't be hot reloaded. For example changing base classes dynamically is impossible to achive in Python so this is not supported and a full reload is needed.

You can go a long way without fully reloading though in many cases.

kwazar90··on Reloadium – Advanced hot reloading for Python
It does update type hints as well!
kwazar90··on Reloadium – Advanced hot reloading for Python
Github actions does not support M1 architecture yet so I could not build wheels for it. Support for self hosted runners is coming soon so I will buy an M1 machine and set up a runner myself.
kwazar90··on Reloadium – Advanced hot reloading for Python
When re-running current function it passes the original arguments (it does not roll them back if changed in the function body - that will be added in the future).
kwazar90··on Reloadium – Advanced hot reloading for Python
I have tried jurigged and I like how lightweight it is. It does not seem to reload changes that relate to other parts of code though. For a given code:

a = 1

b = a + 2

Changing a = 5 will not update b which will still be equal to 3. The same goes to relations between files. Whether it is a flaw or feature it depends on the situation and codebase I guess.

Also it seems like it is not possible to reload currently executing functions (re-entering the function is needed).

kwazar90··on Reloadium – Advanced hot reloading for Python
True, the website needs some doing...
kwazar90··on Reloadium – Advanced hot reloading for Python
Yes hot reloading also works when not suspended and without using debugger. Although you won't be able to reload the current function (currently executing on the call stack) until you suspend it with a breakpoint.
kwazar90··on Reloadium – Advanced hot reloading for Python
How so? I might make this optional if it's misbehaving but so far it's been very useful.
kwazar90··on Reloadium – Advanced hot reloading for Python
As long your code does not state that nothing will happen. About the SQL - the only thing it does is rolling back transaction if you make an error during reloading to recover the db state.
kwazar90··on Reloadium – Advanced hot reloading for Python
As in whether it tracks IO file operations, to know to rollback a file deletion?
kwazar90··on Reloadium – Advanced hot reloading for Python
Interesting, is it already supported?
kwazar90··on Reloadium – Advanced hot reloading for Python
If you intruduce a circular dependency (or any Python execution error) it will rollback all already applied actions, highlight the issue and wait for you to fix it. Reloadium reloads modules across the whole project so it is possible.
kwazar90··on Reloadium – Advanced hot reloading for Python
What limitations exactly do you have in mind? Reloadium does not cause issues with redefined objects ("is" operator issues)
kwazar90··on Reloadium – Advanced hot reloading for Python
Yes it is very difficult, it took me one year and thousands of unit, integration, e2e tests for it to become usable. It is quite stable now although in some situations a full reload still might be needed.