Live data from Hacker News

Jurigged – Hot code reloading for Python

github.com

1–10 of 33 posts

Re: Jurigged – Hot code reloading for Python

#3

This looks impressive, and equally a recipe for utter confusion. I've always thought that it's a brilliant feature of Python that you can edit code while it's running and not affect the process; unlike, say, bash scripts.

In a proper managed environment (whatever that may mean...), this could be useful as a means for continuous integration. Maybe not worth all the hassle, but maybe there's a usecase where this would be a beloved silver bullet.

Re: Jurigged – Hot code reloading for Python

#5

This looks impressive, and equally a recipe for utter confusion. I've always thought that it's a brilliant feature of Python that you can edit code while it's running and not affect the process; unlike, say, bash scripts.

In a proper managed environment (whatever that may mean...), this could be useful as a means for continuous integration. Maybe not worth all the hassle, but maybe there's a usecase where this would be a beloved silver bullet.

Hot code reloading (ala Erlang) is often used in embedded devices for control code where restarting is very expensive. Mostly telco and networking devices.

Re: Jurigged – Hot code reloading for Python

#7
post #4

Wait what? I thought Python was an interpreted language. Did I miss something?

Imported modules are compiled to bytecode and frozen on import, so changing the code in-place won't change what actually get run when the code is called unless you clear the bytecode cache and re-import.

importlib provide a reload method for this purpose: https://docs.python.org/3.8/library/importlib.html#importlib...

Re: Jurigged – Hot code reloading for Python

#9
post #4

Wait what? I thought Python was an interpreted language. Did I miss something?

So? Doesn't change the fact that once you've intepreted a function in some file, you've interpreted it and now it's in memory, and you're going to use the same as long as your program runs (even if you try to reload the module).

(I mean, this is the default case without using something like this project, or other tricks).

Re: Jurigged – Hot code reloading for Python

#10

Is it pronounced "jew rigged?" I'd go with a different name, cause that's like the go-to neo nazi conspiracy theory, that jews rig everything.

Jury rigging is totally different, and the connection to "jews rig everything" is a total stretch (not to mention the tradition phrasing of the conspiracy is that jews RUN everything, not that they rig it).
Post reply on HN