Patrice (@assertnotnull) header
Patrice (@assertnotnull) profile picture

B. Ing. CS #typescript #nodejs, loves #elixir Experienced in microserv. & event sourcing #k8s Lead BE dev @ usewalter

Joined December 2010
Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)Photo by Patrice (@assertnotnull)
In programming, "speed" is not so simple to measure. There are a few measures you look at: Concurrency: The number of things your system can handle at once. Throughput: The actual number of requests served per second in real world conditions. Latency: How long it takes for any one request under real world conditions to complete. This includes queueing delay. Queueing Delay: How long a request has to wait at the front door before your system even starts processing it. You typically are playing a balancing act between maximizing throughput and minimizing latency on any single server, while increasing number of servers (capacity) to account for actual load. A system under load does not behave the same as a system with spare capacity. Raw speed doesn't save you under contention, because "just do the thing as fast as it can possibly be done" is just insufficient. Instead, you have to write your code in such a way that any one given thing can "yield" to other things. If you don't, the requests you're working on finish quickly, but once all of your threads/processes are fully utilized, you have no way to handle more load without introducing queueing (which eventually becomes failures/timeouts) on callers. This brings us to queueing delay. When the system is processing all of the data that it can, the callers have to all just sit there and either wait, retry or fail. If your system were able to accept more concurrent work, you can lower this queuing delay under heavy load. If you can't do that, you end up trading away too much of your goodput (requests that actually succeed within their deadline) in exchange for consistently low latency for the operations that you do handle. When building systems at scale, the general guiding light is keeping the queue delay low, and keeping goodput as high as possible. To do this, you accept as much work as the internal system can track (increasing memory usage typically), allowing latency to go up, in order to accept more concurrent traffic internally. You still need backpressure and load shedding, since no scheduler saves you from arrival rates that permanently exceed what you can serve, but within those bounds you keep goodput maximized. For this to actually work, your internal schedulers need to be able to do something called "preemption". This is where any given operation cannot take an entire CPU core for longer than some given period of time, or for some amount of operations. A "preemptive scheduler" balances work fairly across all of the operations that are asking for CPU cycles. (Work stealing, where idle cores pull queued work from busy ones, helps too, but plenty of cooperative runtimes have that. Preemption is the key part.) The BEAM is a powerhouse for this. It preempts processes by counting "reductions," so no process can hog a scheduler. Immutability and share-nothing processes make that preemption cheap and harmless: a process is never paused while holding a lock someone else needs, and every process has its own heap and garbage collector, so there are no global stop-the-world pauses. This allows BEAM applications to achieve maximal goodput, with very low failures due to queue delay, while spreading latency across all work fairly. Without that preemption, you would see a huge spread among the latency of your system. i.e some requests happening practically immediately, while other requests take pathologically large amounts of time to complete. I get that people want programming language not to matter these days, but at a very minimum you cannot escape the limitations of your runtime. The BEAM's runtime is built for operating at scale, and will always be smoked on benchmarks for tight loop operations where there is no resource contention. #ElixirLang
BEAM is not faster than Rust so something is wrong with the Rust code
7
45
5
275
8,296
Starting to wonder if the smartest way to reduce slop is just to produce less code Force code review to continually reduce code while ALSO keeping cyclomatic complexity low Less code means less code to maintain, fewer bugs
412
133
65
3,963
337,631
Patrice retweeted
People are sleeping on Elixir for a coding harness: * Hot-code swapping allows you to build an extensible plugin system similar to Pi, which reloads live without dropping state * Designing a client-server architecture, similar to OpenCode, is basically a byproduct of the actor model (plus you get both IO/CPU concurrency) * The built-in distribution means you can easily isolate the brains (model + session) from the hands (sandbox + tools). For example, you can the agentic session on your machine which coordinates agents executing inside Docker or a remote node. Or even have one agent session coordinate multiple nodes (this is basically how Livebook works anyway) Those can definitely be built from scratch in other languages, but in Elixir the building blocks are basically part of the runtime.
71
111
17
867
80,394
Sometimes I try to be gentle when it comes to disagreements about technology choices, but I think it is time to start speaking more plainly. #Elixir, #AshFramework and @elixirphoenix are by a wide margin the best choices to build your business and core technology on top of. If you are building with other things, you're just making a bad decision, plain and simple. No, that does not mean you are creating a barrier you cannot surmount. We power through bad decisions every day. Yes, there are specific things I wouldn't choose Elixir for. Mobile apps, hard real time number crunching etc. We have some answers for those that I might use if the use case is bounded and I can see that they fit well (NX etc.), but my unqualified "Elixir is better" is less strong in certain domains. If you are writing a web server, APIs, ETL, etc. there is just flat out no other better option. Fight me bro. I often say things like "well, I'm biased but ..." when qualifying that one should use Elixir, as I'm the author of #AshFramework, but that framing is getting old. I'm not biased. It's just better technology. I'm happy to debate it, and I don't think that anyone who disagrees with me is stupid, but I do think that they are wrong. I don't believe in the "different strokes for different folks" thing anymore.
25
27
7
179
12,755
Patrice retweeted
Elixir v1.20 released! Now officially a gradually typed language: Elixir type checks every single line of code, finding bugs and dead code, without developer overhead (no typing signatures) and extremely low false positives rate. Plus a faster compiler! Links and reports below.
55
307
47
1,486
129,650
I've built a new JavaScript runtime that runs inside the BEAM. Every JS runtime is a GenServer with its own OS thread. No JSON anywhere — JS objects map to BEAM terms natively through a lock-free queue. What makes it different from running Node/Deno/Bun alongside Elixir: → JS runtimes live in supervision trees. They crash, restart, recover state — standard OTP → fetch() goes through :httpc. WebSocket through :gun. crypto.subtle through :crypto. BroadcastChannel through :pg — works across a cluster → The DOM is lexbor (C library). JS renders into it, Elixir reads it directly — no serialization, no re-parsing → Workers are BEAM processes. They get preemptive scheduling for free → TypeScript toolchain (OXC) and npm client built in — no Node.js on the machine at all Full control over the JS layer: parse ASTs, bundle imports, transform TypeScript, minify — all from Elixir via OXC NIFs. Use cases: — SSR with Preact/React into native DOM, Elixir reads the tree — Sandboxed user-defined business rules with memory limits, timeouts, and a controlled API surface — Parallel Workers that compute and broadcast via distributed process groups — Evaluating or bundling TypeScript without any external toolchain — Running npm packages inside the BEAM Still a research project in early beta. Covered with tests including Web Platform Tests ports, but expect rough edges. github.com/elixir-volt/quick…
17
68
8
508
36,036
Patrice retweeted
Saying "isolated processes for fault tolerance are not relevant because they were pushed to orchestration layer" is like saying "we don't need threads, because we will just run one pod per core anyway". The difference in reacting and responding to "my connection pool crashed" by restarting the pool locally vs restarting the whole pod is going to be massive, similar to the differences in latency when coordinating across threads vs across pods. Yes, other programming languages have threads, and they raise a signal when they fail, but that's missing the point. What matters it not the signal but the guarantees. If you have global mutable state and a thread crashes, can you guarantee it did not corrupt the global state? If you can't, the safest option is to restart the whole node anyway, because it is best to have a dead node than running a corrupted one. PS: somewhat related 6-years-old post: dashbit.co/blog/kubernetes-a…
This is why I’m unimpressed by Erlang/Elixir: every major language runtime has VERY high-quality M:N work-stealing “thread” schedulers with good APIs (structured concurrency), and the “isolated processes” and “RPC” got pushed up to an orchestration layer (DC/OS, Nomad, k8s…)
9
49
4
369
45,947
Patrice retweeted
Hi there, Elixir friends! Hologram v0.7.0 is out! :) 49 contributors ported 150 Erlang functions to JS, pushing client-side Erlang runtime coverage from 34% to 96%. Hologram compiles Elixir to JavaScript, enabling full-stack development in pure Elixir - and soon, Local-First apps. hologram.page/blog/porting-i… #Hologram #Elixir #ElixirLang #BEAM #WebDev
16
22
1
155
7,146
The top critical replies to Coder Girl here were "4 hours fixing audio drivers nobody asked about", "Installing Linux is a mess", and "sure if you don't like to game". I have been a Linux user since SlackWare in the mid 90s. I would have agreed with all three of those up until around a year ago. Here is the reality I have been experiencing now: 1) My livingroom gaming machine is now permanently Bazzite. I installed the default Bazzite distribution from a USB key with no modifications. It can run Steam in deck mode, so I can use it with my (Microsoft!) XBox controller, and I play almost exclusively Windows games on it, which run (shockingly) flawlessly in Proton. I have yet to encounter a single compatibility problem, although I am sure I would if I played competitive shooters since their anticheat kernel drivers are designed to prevent using it anywhere but on unaltered Windows distributions. Anticheat is really the only thing holding Linux back from being an immediate substitute for a Windows gaming machine. 2) My audio workstation is now also Bazzite, since I figured it was easier than maintaining two distros. Default install just worked, no drivers necessary, despite the equivalent Windows install needing both Yamaha and Behringer drivers to be installed manually to function properly. It "just worked" out of the box for audio as compared to the Windows equivalent, and has been rock solid - no drop outs, no crashes. I did not have to touch a single audio configuration option. I just installed Reaper and PianoTeq, and everything worked. 3) The only machine I've found so far that has trouble working out-of-the-box with Linux is a Microsoft Surface tablet. But I still got it to work, it just required me to manually install a kernel patch because support for things like the Surface touchscreen aren't built into Linux distros currently. Once I did install the patch manually, it works perfectly, and even has a touchscreen keyboard just like Windows does. So even Microsoft's own hardware can run Linux just fine, and it would even be turnkey if your Linux distro of choice decided to mainline the Surface driver repo. The bottom line is that people who think Linux is worse than Windows either haven't used it lately, or are not being honest about how bad Windows has become. Windows is circling the drain. Every update, it gets worse. The number of problems I regularly have to solve on our remaining Windows machines dwarf anything I have to do for Linux system maintenance. Windows had a good run, but Microsoft has obviously focused its resources on SaaS and cloud computing. They don't care about Windows anymore, and neither should you. The next decade is about transitioning to Linux everywhere.
LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS LINUX IS BETTER THAN WINDOWS
290
391
47
5,998
462,069
Gold
I wrote Task Unmanager: keeps killing processes Russian Roulette style, until your machine crashes
1
48
I cannot believe any serious company would use @meteorjs for their business. The cons far outweight the outdated pros. 🧵
1
1
35
The developer has to deal with the build system in place. It bundle all the code in a module.js file of megabytes size. No async loading. This is not made for slow networks.
1
12
Typescript is installed through meteor install. Outside of package.json. How can you know this will be a good integration of typescript? You are limited by the version of typescript meteor pacakge. You have to wait for the community to update it.
10
So... Postgres is now basically a search engine? pg_textsearch was just open sourced. It enables BM25 to search your database.... massive upgrade for key word search. Google uses BM25 in their search engine. Claude told me: "if you're already on Postgres, you can now skip the whole sync-your-data-to-Elasticsearch dance for search." (ps, how can you not love Claude). Now I got to figure out how to implement in my Django querysets... future course? Grab it at github.com/timescale/pg_text… #sponsored
83
397
45
4,929
508,004