Live data from Hacker News

Elixir/Erlang Hot Swapping Code (2016)

kennyballou.com

41–50 of 119 posts

Re: Elixir/Erlang Hot Swapping Code (2016)

#41

i'm so sick of this DevOps bullshit i wonder if there is an alternative language that you can hot swap code and do all the black magic stuff while keeping the reliability and performance like Rust.

Erlang is built for reliability. They're chasing nine nines. Everything about the BEAM is built to emphasize that, the design choices, the documentation, the recommended practices. Erlang is not very fast, but that's not what it was built for.

Is it really beam or just otp? Sure, beam gives you processes, network-transparent send, immutable structures and linking-monitoring thingy on top, but is what makes it good to shoot for nines?

I suspect the aura of mistycism around yet another jit vm is not that warranted

Re: Elixir/Erlang Hot Swapping Code (2016)

#42

i'm so sick of this DevOps bullshit i wonder if there is an alternative language that you can hot swap code and do all the black magic stuff while keeping the reliability and performance like Rust.

we had this wonderful thing in PHP where you would just save a .php file and bada bing it was LIVE. what happened? :D

We still have that and it is awesome. PHP is better than ever.

In serious emergencies I even sometimes end up quickly SSH-en to a prod server and changing the file directly. Which is kind of horrifying but hey customer is happy it got fixed immediately and I get to relax and take my time to write a proper fix. Beats sweating and watching the pipeline build and asking around for people to approve my merge request.

Re: Elixir/Erlang Hot Swapping Code (2016)

#43
post #35
post #29

Earlier quoted context omitted.

> Most of those hot fixes are data driven as in database updates. Gameserver just reload the data, the binary itself is not touch. And since the data from the disk/database (whether it's a Lua table, XML structure, JSON object, or a query) is then representend as a low-level data structure, that's essentially what hot reloading is - you deserialize the new data and hot-swap the pointers in the simplest terms. >I've n…

Yes but again it's not hot swapping code as in Erlang, the C++ code is unchanged, they just change some xml somewhere. By your definition every CRUD app have hot reloading capabilities.

Why does it matter the language? C++ built in the tooling to allow hot swapping, no?

Re: Elixir/Erlang Hot Swapping Code (2016)

#44
post #41

Earlier quoted context omitted.

Erlang is built for reliability. They're chasing nine nines. Everything about the BEAM is built to emphasize that, the design choices, the documentation, the recommended practices. Erlang is not very fast, but that's not what it was built for.

Is it really beam or just otp? Sure, beam gives you processes, network-transparent send, immutable structures and linking-monitoring thingy on top, but is what makes it good to shoot for nines? I suspect the aura of mistycism around yet another jit vm is not that warranted

It is reasonable to conceive of Erlang as encompassing OTP. Perhaps somewhere in the world there is some developer out there hot on Erlang but just hates OTP and doesn't use it, but they must be fairly frustrated at how hard it is to keep OTP out of their code base if they ever need any libraries.

Restarting is arguably the definitive thing that makes Erlang stack the 9s out past what most languages and runtimes can achieve... the thing is, it's more complicated to use in practice than a web page like this makes it look, and it's beyond what most products need. Few applications need the fifth or sixth or seventh nine, and it gets to the point that you can't have it anyhow because your Erlang cluster, no matter how well distributed, itself probably doesn't have 99.99999 availability, and your users probably don't have 99.99999 availability on their own network connection.

It's not impossibly complicated, but it is the sort of thing where you if you want to use the feature you need to have it sort of constantly in mind as you write the rest of your system, and it's a lot easier even in Erlang to just design the system to take entire nodes down and bring them back up, if not the entire cluster down, rather than fuss with hot reloads. I wish Erlang advocates would be more upfront about pitching this as an interesting niche feature, but not really a reason to consider Erlang. Unless you absolutely need it, in which case it can indeed be the thing that puts it on the short list of choices... but as evidenced by the vast, vast majority of software and systems not being on Erlang and managing to get along, there aren't really that many things that need it.

Re: Elixir/Erlang Hot Swapping Code (2016)

#45
post #43
post #35

Earlier quoted context omitted.

Yes but again it's not hot swapping code as in Erlang, the C++ code is unchanged, they just change some xml somewhere. By your definition every CRUD app have hot reloading capabilities.

Why does it matter the language? C++ built in the tooling to allow hot swapping, no?

C++ because 99% of the major games are built in that language.

Re: Elixir/Erlang Hot Swapping Code (2016)

#46
post #5

hot reload of code is nothing new nowadays, but people use it only locally during development for REPL like development style. in actual production, people prefer to operate at the container level + traffic management, and dont touch anything deeper than the container

I work at a company that deploys Elixir/Erlang and while we do /prefer/ to push a fully tested build in a new container, sometimes things get nasty and we need to console in and re-define a module in production. It's not a "best practice" but it stems the bleeding while the best practice is going though its test suite.

Re: Elixir/Erlang Hot Swapping Code (2016)

#47
post #16
post #5

hot reload of code is nothing new nowadays, but people use it only locally during development for REPL like development style. in actual production, people prefer to operate at the container level + traffic management, and dont touch anything deeper than the container

> in actual production, people prefer to operate at the container level + traffic management, and dont touch anything deeper than the container How do you think video games like World of Warcraft or Path of Exile deploy restartless hotfixes to millions of concurrent players without killing instances? I don't think it's a matter of "prefer to", it's a matter of "can we completely disrupt the service for users and pote…

In addition to what most people said, many other game servers just simply announce upcoming maintenance work and take the services offline until the patches are deployed.

This way they can properly test everything and rollback any potential fixes if required.. even banking systems regularly goes down for maintenance.

Re: Elixir/Erlang Hot Swapping Code (2016)

#48
post #4

i'm so sick of this DevOps bullshit i wonder if there is an alternative language that you can hot swap code and do all the black magic stuff while keeping the reliability and performance like Rust.

I am shocked at the idea of anyone implying that Erlang is "unreliable"... it's entire reason for existence was to step up the game on reliability.

As someone who is now in the rust world and very very sympathetic to the Erlang world... you both probably mean completely different things when you say "reliable". The contexts are just world apart.

Re: Elixir/Erlang Hot Swapping Code (2016)

#50
post #30

Earlier quoted context omitted.

FWIW as soon as you start using containers you should be able to handle those containers spinning up/down. Pretty much the whole point of containers. At which point you don’t need to bother with code hot swapping since you already have a mechanism for newer containers to spin up while older ones spin down. The sibling post “that’s how they update without downtime” is super naive. It is absolutely not how they do it.

That's kinda what erlang does, just on a different level. Your docker and your load balancer are both inside your app.

If we to wedge how Erlang does hot code swapping into a container metaphor, then to get what Erlang does, you'd need to have a container per function call.

Given that it would be absurdly wasteful to use OS processes in containers to clone Erlang's code reload system, AnotherGoodName might take ten minute to watch Erlang: The Movie to get a better sense of the capabilities of that system. The movie is available from many places, including archive.org.

Post reply on HN