frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

https://lucassifoni.info/blog/leveraging-hot-code-loading-for-fun-and-profit/
128•ronxjansen•7mo ago

Comments

chantepierre•7mo ago
Author 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).

ralphc•7mo ago
Why Vue over the other JS frameworks?
chantepierre•6mo ago
Personal habit, honestly. If I had to re-start I'd probably pick React today, but the Vue switch to a composition API make me like it enough when I was thinking of switching.

What I'm truly rooting for is a non-limited Elm.

ipnon•7mo ago
Elixir is the best general purpose programming language for distributed systems.
isodev•7mo ago
It's also the best ecosystem for indie/small team development. With a handful of well-established libraries, one can go a long way without having to reach for separate/dedicated queue/messaging systems, job or workflow orchestrations, even spinning up an ephemeral machine just to run heavy workloads is not complex. Frameworks like Ash make an entire category of server applications a matter of a few declarative modules.
pclowes•7mo ago
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 existing code already built and battle tested for specific purposes.

darkmarmot•7mo ago
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.
ralphc•7mo ago
I'd like to have a look at those, have a github link?
darkmarmot•6mo ago
Yes! Thanks for the interest, hope they're helpful!

for HL7: https://hexdocs.pm/elixir_hl7/main.html

for MLLP: https://hexdocs.pm/mllp/readme.html

ipnon•6mo ago
To put it simply, the BEAM lets you swallow all of your dependent services into a consistent API, no matter network distance or machine dependability. In Python it feels like my main thread, DB, job queue, and OS are all speaking different languages. With Elixir I don't spend much time at all getting different services to work together, at least an order of magnitude less.

Elixir is not perfect, but for me working alone dependency hell was the bottleneck with Python. Now the bottleneck is adding features, which is right where it should be.

vendiddy•6mo ago
I think in many cases the ecosystem issues are overblown. For the common 90% of use cases there are battle tested libraries out there.

For the less common ones, we tend to just roll our own which in most cases isn't that bad if you have reference implementations.

I think the most under-appreciated aspect of Elixir is how it helps reduce complexity. And there isn't a silver bullet here, but the tooling, immutability, pattern matching, process-based concurrency model, etc are all design decisions that, IMHO lead to simpler, more robust code.

(Caveat: of course, like any language, you can make a mess of things.)

I'm curious what libraries they wish existed.

lenkite•6mo ago
Out of curiosity, what does one use for distributed storage in Elixir ?
fud101•7mo ago
I thought elixir devs have cooled on the whole hot reload update or is this different?
conradfr•7mo ago
That seems more about loading dynamic code.
elitepleb•7mo ago
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
diggan•7mo ago
> 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?

elitepleb•7mo ago
queued messages stay around in the mailboxes, so no state is lost, but don't get migrated/transformed/versioned via the appup mechanism, unless you opt back into it via libraries for it like https://github.com/ausimian/castle
toast0•7mo ago
I've used utility functions in Erlang where I make changes, then compile and load all modified modules...

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.

throwawaymaths•7mo ago
no, for example if you are running a liveview in dev and recompiling your code the liveview does not lose its state and jumps into the new module, unless I'm mistaken.
thibaut_barrere•7mo ago
Overall, it's not widely used nor pushed (blue green deployments are now very common), but it still has interesting uses.

For instance, very high availability without blue-green (using a front-end that can be hot-patched), or... musical endeavors (such as live reloading code that generates music, on the go) https://youtu.be/_VgcUatTilU?si=DDfe4FN3Nw9OzRhF&t=122

chantepierre•7mo ago
I'm not using this to update the app itself - which is a docker container that gets updated when I push a new version. I'm simply using the BEAM's code loading capabilities to add client-specific parts to the app while it is running. They are part of the monorepo (and thus part of the app at dev time), but get stripped at build-time so they can be selectively loaded later.
ethan_smith•7mo ago
Hot code reloading for development (recompile-on-save) has issues, but production hot code loading for zero-downtime deployments is still a core BEAM strength and what this article focuses on.
vendiddy•6mo ago
To be fair, I think most apps don't need zero-downtime deployments in the telcom sense.

Most host have blue-green deploy options which reduce downtime and there are fewer corner cases to deal with.

I find local recompile very useful for prototyping in development mode. So much so that I have a keyboard shortcut to trigger a recompile. (I don't like recompile on save.)

darkmarmot•7mo ago
We run a large distributed cluster (currently 4 DCs spanning the US) and use hot code reload for live patches when needed and rolling deployments for our standard releases.
chantepierre•6mo ago
To add to this topic, people who do not know about erlang's hot code loading should watch this talk : https://www.youtube.com/watch?v=pQ0CvjAJXz4

A multi-DC running cluster where parts are progressively swapped at runtime. No database, only OTP.

svkids•6mo ago
I wonder how the elixir will do in different temp circumstances

Show HN: I decomposed 87 tasks to find where AI agents structurally collapse

https://github.com/XxCotHGxX/Instruction_Entropy
1•XxCotHGxX•3m ago•1 comments

I went back to Linux and it was a mistake

https://www.theverge.com/report/875077/linux-was-a-mistake
1•timpera•4m ago•1 comments

Octrafic – open-source AI-assisted API testing from the CLI

https://github.com/Octrafic/octrafic-cli
1•mbadyl•5m ago•1 comments

US Accuses China of Secret Nuclear Testing

https://www.reuters.com/world/china/trump-has-been-clear-wanting-new-nuclear-arms-control-treaty-...
1•jandrewrogers•6m ago•1 comments

Peacock. A New Programming Language

1•hashhooshy•11m ago•1 comments

A postcard arrived: 'If you're reading this I'm dead, and I really liked you'

https://www.washingtonpost.com/lifestyle/2026/02/07/postcard-death-teacher-glickman/
2•bookofjoe•12m ago•1 comments

What to know about the software selloff

https://www.morningstar.com/markets/what-know-about-software-stock-selloff
2•RickJWagner•16m ago•0 comments

Show HN: Syntux – generative UI for websites, not agents

https://www.getsyntux.com/
3•Goose78•17m ago•0 comments

Microsoft appointed a quality czar. He has no direct reports and no budget

https://jpcaparas.medium.com/ab75cef97954
2•birdculture•17m ago•0 comments

AI overlay that reads anything on your screen (invisible to screen capture)

https://lowlighter.app/
1•andylytic•18m ago•1 comments

Show HN: Seafloor, be up and running with OpenClaw in 20 seconds

https://seafloor.bot/
1•k0mplex•18m ago•0 comments

Tesla turbine-inspired structure generates electricity using compressed air

https://techxplore.com/news/2026-01-tesla-turbine-generates-electricity-compressed.html
2•PaulHoule•20m ago•0 comments

State Department deleting 17 years of tweets (2009-2025); preservation needed

https://www.npr.org/2026/02/07/nx-s1-5704785/state-department-trump-posts-x
2•sleazylice•20m ago•1 comments

Learning to code, or building side projects with AI help, this one's for you

https://codeslick.dev/learn
1•vitorlourenco•21m ago•0 comments

Effulgence RPG Engine [video]

https://www.youtube.com/watch?v=xFQOUe9S7dU
1•msuniverse2026•22m ago•0 comments

Five disciplines discovered the same math independently – none of them knew

https://freethemath.org
4•energyscholar•23m ago•1 comments

We Scanned an AI Assistant for Security Issues: 12,465 Vulnerabilities

https://codeslick.dev/blog/openclaw-security-audit
1•vitorlourenco•23m ago•0 comments

Amazon no longer defend cloud customers against video patent infringement claims

https://ipfray.com/amazon-no-longer-defends-cloud-customers-against-video-patent-infringement-cla...
2•ffworld•24m ago•0 comments

Show HN: Medinilla – an OCPP compliant .NET back end (partially done)

https://github.com/eliodecolli/Medinilla
2•rhcm•27m ago•0 comments

How Does AI Distribute the Pie? Large Language Models and the Ultimatum Game

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6157066
1•dkga•27m ago•1 comments

Resistance Infrastructure

https://www.profgalloway.com/resistance-infrastructure/
3•samizdis•32m ago•1 comments

Fire-juggling unicyclist caught performing on crossing

https://news.sky.com/story/fire-juggling-unicyclist-caught-performing-on-crossing-13504459
1•austinallegro•32m ago•0 comments

Restoring a lost 1981 Unix roguelike (protoHack) and preserving Hack 1.0.3

https://github.com/Critlist/protoHack
2•Critlist•34m ago•0 comments

GPS and Time Dilation – Special and General Relativity

https://philosophersview.com/gps-and-time-dilation/
1•mistyvales•37m ago•0 comments

Show HN: Witnessd – Prove human authorship via hardware-bound jitter seals

https://github.com/writerslogic/witnessd
1•davidcondrey•37m ago•1 comments

Show HN: I built a clawdbot that texts like your crush

https://14.israelfirew.co
2•IsruAlpha•39m ago•2 comments

Scientists reverse Alzheimer's in mice and restore memory (2025)

https://www.sciencedaily.com/releases/2025/12/251224032354.htm
2•walterbell•42m ago•0 comments

Compiling Prolog to Forth [pdf]

https://vfxforth.com/flag/jfar/vol4/no4/article4.pdf
1•todsacerdoti•44m ago•0 comments

Show HN: Cymatica – an experimental, meditative audiovisual app

https://apps.apple.com/us/app/cymatica-sounds-visualizer/id6748863721
2•_august•45m ago•0 comments

GitBlack: Tracing America's Foundation

https://gitblack.vercel.app/
16•martialg•45m ago•2 comments