frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Async Ruby Is the Future of AI Apps (and It's Already Here)

https://paolino.me/async-ruby-is-the-future/
43•doppp•14h ago

Comments

Alifatisk•3h ago
What an interesting perspective on Ruby async, the I/O multiplexing example was quite faschinating to see aswell
hakunin•2h ago
Gotta give credit for wonderfully clear writing. You can tell a person understands what they're saying by how well they express it. Reads smooth, and makes me see the author's mental model.

As far as substance: I love ruby libraries that allow you to simply "insert any ruby code". Many libraries tell you to call specific declarative functions, but I think Ruby shines at letting you use Ruby, instead of some limited subset of it. Examples of not-great approaches (imo) are libraries that try to take over how you write code, and give you a special declarative syntax for runtime type checking, building services out of lambdas, composing functions. Ruby's async is an example of "just insert any ruby in here". You can build runtime type checking the same way — allow people to check the value with any ruby code they like. Essentially, I agree with author's sentiment, and wish more people appreciated the beauty of this approach.

earcar•2h ago
Author here. Thank you, that means a lot!

Happy to answer any questions.

horsawlarway•2h ago
Mmmm...

I find it somewhat ironic that you pitch this as "No callbacks. No promises. No async/await keywords. Just Ruby code that scales."

When you literally show in the example right above that you need both an "async do" and a "end.map(&:wait)".

I'll add - the one compelling argument you make about needing a db connection per worker is mitigated with something like pgbouncer without much work. The OS overhead per thread (or hell, even per process: https://jacob.gold/posts/serving-200-million-requests-with-c...) isn't an argument I really buy, especially given your use case is long running llm chat tasks as stated above.

Personally - if I really want to be fast and efficient I'm not picking Ruby anyways (or python for that matter - but at least python has the huge ecosystem for the LLM/AI space right now).

earcar•1h ago
Fair point on the syntax, I should have been clearer. What I meant is that your existing Ruby code doesn't need modifications. In Python you'd need to use a different HTTP library, add `async def` and `await` everywhere, etc. In Ruby the same `Net::HTTP` call works in both sync and async context.

The `Async do` wrapper just at the orchestration level, not throughout your codebase. That's a huge difference in practice.

Regarding pgbouncer - yes, it helps with connection pooling, but you still have the fundamental issue of 25 workers = 25 max concurrent LLM streams. Your 26th user waits. With fibers, you can handle thousands on the same hardware because they yield during the 30-60s of waiting for tokens.

Sure, for pure performance you'd pick another language. But that's not the point - the point is that you can get much better performance for IO-bound workloads in Ruby today, without switching languages or rewriting everything.

It's about making Ruby better at what it's already being used for, not competing with system languages.

hakunin•48m ago
> Personally - if I really want to be fast and efficient I'm not picking Ruby anyways (or python for that matter - but at least python has the huge ecosystem for the LLM/AI space right now

"Fast and efficient" can mean almost anything. You can be fast and efficient in Ruby at handling thousands of concurrent llm chats (or other IO-bound work), as per the article. You can also be fast and efficient at CPU-bound work (it's possible to enjoy Ruby while keeping in mind how it will translate into C). You probably cannot be fast and efficient at micro-managing memory allocations in Ruby. If you're ok to brush ruby aside over a vague generalization, maybe you just don't see its appeal in the first place, which is fair, but that makes the other reasons you provide kind of moot.

Show HN: Caret – The most accurate AI meeting notetaker (really)

https://caret.so/en
1•hiddenest•19s ago•0 comments

Influencr.co – a new platform helping influencers monetize via rev share

https://influencr.co/
1•UrbanBird•1m ago•1 comments

After age forty, feelings of career autonomy tend to decline

https://www.pnas.org/doi/10.1073/pnas.2504419122
1•speckx•2m ago•0 comments

The small details that make big UX

https://agnamihira.medium.com/the-small-details-that-make-big-ux-5ac67c162829
1•agnamihira•3m ago•1 comments

Show HN: Dime – dropping noisy coordinates can lift dense-retrieval quality

https://github.com/pinecone-io/unveiling-dime
2•amallia•4m ago•1 comments

Why Cursor Is About to Ditch Vector Search (and You Should Too)

https://www.tigerdata.com/blog/why-cursor-is-about-to-ditch-vector-search-and-you-should-too
1•looppp•5m ago•0 comments

Careful upgrading to cert-manager 1.18

https://www.buoyant.io/blog/careful-with-cert-manager-1-18
2•rdoherty•5m ago•0 comments

Rolling out binary authorization for all laptops at Figma

https://www.figma.com/blog/rolling-out-santa-without-freezing-productivity/
1•robszumski•6m ago•0 comments

Measuring the Impact of AI on Experienced Open-Source Developer Productivity

https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/
2•dheerajvs•8m ago•0 comments

How to Build Agents Users Can Trust

https://builders.ramp.com/post/how-to-build-agents-users-can-trust
1•cjen•9m ago•0 comments

Show HN: Credit Card Generator for Devs and Testers

2•rahulbstomar•10m ago•0 comments

Leveraging the S&P500

https://niklasbuschmann.github.io/SP500/
2•niklasbuschmann•10m ago•0 comments

Bitcoin soars to all-time peak just shy of $112,000

https://www.reuters.com/world/africa/dollar-gains-against-yen-trumps-trade-war-intensifies-2025-07-09/
1•wslh•11m ago•1 comments

Musk Admits Grok AI 'Lacks Common Sense,' Reveals Pricey $300 Monthly Plan

https://www.pcmag.com/news/musk-admits-grok-ai-lacks-common-sense-reveals-pricey-300-monthly-plan
3•Bluestein•11m ago•0 comments

Reinforcement Learning for Reka Flash 3.1

https://reka.ai/news/reinforcement-learning-for-reka-flash-3-1
1•Philpax•12m ago•0 comments

JSON Programming Language

https://github.com/W1LDN16H7/JPL
2•vips7L•12m ago•0 comments

To Build a Retro Sonic World, Learn Some Retro Copyright Law

https://continuous-wave.beehiiv.com/p/to-build-a-retro-sonic-world-learn-some-retro-copyright-law
1•danko•13m ago•0 comments

Show HN: I built a tool that explains ArXiv papers in simple language

https://arxivexplained.com
1•grantsingleton•14m ago•0 comments

Maven's transitive dependency hell and how we solved it

https://www.stainless.com/blog/maven-transitive-dependency-hell-and-how-we-solved-it
1•tomeraberbach•16m ago•0 comments

Show HN: Ten years of running every day, visualized

https://nodaysoff.run
7•friggeri•16m ago•0 comments

AI Cloned a Trending Mobile Game (Sand Blast Puzzle) for Web in Hours

https://sandblastgame.com
1•Kevin_Guo•17m ago•1 comments

My 9-week unprocessed food self-experiment

https://dynomight.net/unprocessed-food/
1•crescit_eundo•18m ago•0 comments

An Underwater Fossil Find Includes Remains from Ancient Human Ancestors

https://www.smithsonianmag.com/smart-news/a-massive-underwater-fossil-find-includes-remains-from-ancient-human-ancestors-180986957/
1•Brajeshwar•18m ago•0 comments

Dams around the world hold so much water they've shifted Earth's poles

https://www.livescience.com/planet-earth/dams-around-the-world-hold-so-much-water-theyve-shifted-earths-poles-new-research-shows
1•Brajeshwar•18m ago•0 comments

Bribe or community benefit? Sweeteners for renewables need to be done right

https://theconversation.com/bribe-or-community-benefit-sweeteners-smoothing-the-way-for-renewables-projects-need-to-be-done-right-258903
2•PaulHoule•21m ago•0 comments

ping.sx: Ping/MTR endpoints online from multiple worldwide regions

https://ping.sx/mtr
1•indigodaddy•24m ago•1 comments

Seven Engineers Suspended After $2.3M Bridge Includes 90-Degree Turn

https://www.vice.com/en/article/7-engineers-suspended-after-2-3-million-bridge-includes-bizarre-90-degree-turn/
40•_sbl_•26m ago•17 comments

Most engineering teams (90%) now use AI coding tools – what's next?

https://www.businessinsider.com/ai-coding-tools-popular-github-gemini-code-assist-cursor-q-2025-7
1•logic_node•26m ago•1 comments

Show HN: RunPy – simple desktop app for tinkering with Python

https://runpy.app
1•lukehaas•31m ago•0 comments

AI Tooling, Evolution and the Promiscuity of Modern Developers

https://redmonk.com/sogrady/2025/07/09/promiscuity-of-modern-developers/
1•ulrischa•33m ago•0 comments