Elixir is the best general purpose programming language for distributed systems.
Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
11–20 of 27 posts
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#12Earlier quoted context omitted.
Elixir removed a jankier https://www.erlang.org/doc/apps/sasl/appup.html mechanism that defined how state is upgraded or downgraded, while watching a directory and recompiling a module automatically or manually from the repl is still common
> while watching a directory and recompiling a module automatically or manually from the repl is still common That makes it sound like the "hot" part has been removed then, and it's just basically a "live reload" rather than "hot code loading", is that right? There is no persistent state and you get a fresh one after the automatic compilation happened?
It's absolutely hot loading, there's persistent state, any fully qualified function calls run in the newest module. The gen_server pattern always calls into your behavior module with fully qualified calls, so those are pretty easy to get into new code at a reasonable time. If you write your own service loop, it's pretty common to call ?MODULE:loop() to enable hotloading there too.
There's footguns; hotloading is a way to make rapid changes to your system, but sometimes rapid changes isn't what's needed and sometimes the rapid change you make is to go from a partially broken system to a fully broken system. But, there's a virtuous circle when you can make production changes quickly, because you can make a small change and observe and make many follow ups in a single day. With push processes that take a long time, you end up encouraged to make a bigger change one time, otherwise you spend all day waiting for traffic to move between old and new versions, or waiting for instances to deploy, etc.
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#13Elixir is the best general purpose programming language for distributed systems.
I know a team using it to replace ancient massive mainframe based systems with modern distributed systems and the gist is that the language is fine, but mostly ideal for use cases that leverage the ErlangVM or BEAM stack.
The downside they run into is the ecosystem isnt there, at least a couple guys wish they had just used Kotlin/Java for library interoperability with so much existing code already built and battle tested for specific purposes.
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#14Elixir is the best general purpose programming language for distributed systems.
What makes you say that? Honestly asking. I know a team using it to replace ancient massive mainframe based systems with modern distributed systems and the gist is that the language is fine, but mostly ideal for use cases that leverage the ErlangVM or BEAM stack. The downside they run into is the ecosystem isnt there, at least a couple guys wish they had just used Kotlin/Java for library interoperability with so much…
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#15I thought elixir devs have cooled on the whole hot reload update or is this different?
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#16I thought elixir devs have cooled on the whole hot reload update or is this different?
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#17Author here, thanks for sharing ! Happy to answer any questions. I think the article outlines it, but I'm at very low scale, with custom development for every client. I mostly build mini-figmas, collaborative or not, that automate specific document pipelines on top of my software, backed by elixir+liveview (or elixir+vue+channels).
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#18Earlier quoted context omitted.
What makes you say that? Honestly asking. I know a team using it to replace ancient massive mainframe based systems with modern distributed systems and the gist is that the language is fine, but mostly ideal for use cases that leverage the ErlangVM or BEAM stack. The downside they run into is the ecosystem isnt there, at least a couple guys wish they had just used Kotlin/Java for library interoperability with so much…
I think that's a good point. Our largest pain point with Elixir is definitely the size of the community and the associated dearth of niche libraries. The technology behind it, though, is solid enough that once those libraries exist, things really take off. My team wrote several open source medical libraries for Elixir and we've seen it really expand into the healthcare market.
Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app
#19Earlier quoted context omitted.
Elixir removed a jankier https://www.erlang.org/doc/apps/sasl/appup.html mechanism that defined how state is upgraded or downgraded, while watching a directory and recompiling a module automatically or manually from the repl is still common
> while watching a directory and recompiling a module automatically or manually from the repl is still common That makes it sound like the "hot" part has been removed then, and it's just basically a "live reload" rather than "hot code loading", is that right? There is no persistent state and you get a fresh one after the automatic compilation happened?