4 ms·
The Lisp instinct is to make a change in a file and immediately hit C-c C-c in Emacs, at which point the change goes live in the system - no matter if it's a va
by phoe-krk 4y ago
The Lisp instinct is to make a change in a file and immediately hit C-c C-c in Emacs, at which point the change goes live in the system - no matter if it's a variable or a function that you have changed or something else.
You don't need to reload the full module like in BEAM languages like Erlang or Elixir, you can modify a single function or a form without the need to make a version upgrade to the processes running your code - the next time any thread, including e.g. an already running game loop, ends up calling the new function, it's the new version of the function that will end up being called.
- ramchip 4y agoVersion upgrades are not needed on BEAM anymore than they are in Lisp, you can just reload a module and code will start using the new version.
- phoe-krk 4y agoTIL, that's a big thing! When was that change made?
- ramchip 4y agoI don't think it's recent, as far as I know. Versioning, appup / relup, etc. are really for upgrading production deployments live, when you need special instructions to pause processes or update their internal state before loading new code. In development, you can ignore all that and just reload modules directly. e.g. with "r" in the Elixir REPL. Once that's done any external call (`MyModule.add(1,2)`) will go to the new version of the code, while local calls (`add(1,2)`) stay on the same version. The Phoenix web framework will also auto-reload any module that has changed on disk when handling a web request in dev mode.