Comment by znnajdla
11 days ago
> Even if you use heavyweight OS threads, I just don't believe this matters.
It matters a lot. How many OS threads can you run on 1 machine? With Elixir you can easily run thousands without breaking a sweat. But even if you need only a few agents on one machine, OS thread management is a headache if you have any shared state whatsoever (locks, mutexes, etc.). On Unix you can't even reliably kill dependent processes[1]. All those problems just disappear with Elixir.
[1] https://matklad.github.io/2023/10/11/unix-structured-concurr...
Presumably if you can afford to pay for all those tokens the computational cost should be mostly insignificant?
Spending too much time optimizing for the 1% of extra overhead seems suboptimal..
Even if I was building one single agent for a one off hobby project I would still use Elixir. It’s elegantly suited to the job. With any long running failure prone process you’re constantly writing try/catches, health checks, network timeouts, retries, and a whole lot of other orchestration stuff just to keep a flaky real world agent running. With Erlang it’s all just a built in state machine. The process knows what state it is in, crashes, recovers gracefully in exactly the right state.
> How many OS threads can you run on 1 machine?
Any modern Linux machine should be able to spawn thousands of simultaneous threads without breaking a sweat.