Goru, an experimental, Go-inspired concurrency library for Ruby
Hey folks, wanted to show this off and get feedback. Still early/experimental but there are quite a few concepts I'm excited about here. This project came about while writing a program in Go and loving its approach to concurrency. Being a long-time Rubyist I immediately started to think about what similar concepts might look like in Ruby. I set out with two main design constraints: 1. Lightweight: I didn't want routines to be backed by fibers or threads. Having been involved some in the async project (https://github.com/socketry/async), I had some experience using…
What it does
In the maker’s words, at launch
Hey folks, wanted to show this off and get feedback. Still early/experimental but there are quite a few concepts I'm excited about here. This project came about while writing a program in Go and loving its approach to concurrency. Being a long-time Rubyist I immediately started to think about what similar concepts might look like in Ruby. I set out with two main design constraints: 1. Lightweight: I didn't want routines to be backed by fibers or threads. Having been involved some in the async project (https://github.com/socketry/async), I had some experience using fibers for concurrency but was curious if they could be avoided. 2. Explicitness: Routine behavior must be written to describe exactly how it is to behave. I always felt like concurrent code was hard to fully understand because of the indirection involved. On the spectrum between tedium and magical I wanted to err more on the side of tedium with Goru. Goru routines are just blocks that are called once for every tick of the reactor. It is up to the developer to implement behavior in terms of a state machine, where on each tick the routine takes some action and then updates the state of the routine for the next tick. This fulfills both design constraints: 1. Because routines are just blocks, they weigh in at about ~345 bytes of memory overhead. 2. Routine behavior is explicit because it is written as a state machine inside the block. Couple more features worth noting: * Goru includes channels for buffered reading/writing (similar to channels in Go). * Goru ships with primitives for non-blocking IO to easily build things like http servers. Curious your thoughts!
Does the same job
all alternatives →- BRBestRuby – Ruby Tricks, Idioms, Refactorings and Best Practices2015 · best-ruby.com · ▲92
- ALA LRU cache using go generics2022 · github.com · ▲57
- OAOmniref - a better search site for Ruby documentation2013 · omniref.com · ▲110
- IWI wrote a book about using Lambda with Go2021 · ▲103
Hi HN! During the last few years, I worked on a few applications built with Go, running on AWS Lambda. As I got to know the platform better, I started to find Go & Lambda to be a really productive combination. The applications were fast, and they ended up being much cheaper to run than what my team & I had built before. It’s probably not the best platform for _every_ application, but I was surprised at how much of our workload worked well on it. As we brought new engineers on to our team and helped them get up to speed with the stack, I found that we were covering a lot of the same topics…
- GVGoLang vs. Python: deep dive into the concurrency2018 · made2591.github.io · ▲10
- GAGochan – A library of channel architectures for Go, inspired by RustMay 2026 · github.com · ▲5
Hi All, I felt like I was re-inventing the wheel by bolting similar channel architectures onto different Go structs repeatedly so I decided to extract some common types into into one library so that they would be easier to re-use: - oneshot - spsc - spmc - mpsc - mpmc - broadcast - watch The types are inspired by Rust channels so if you're coming from Rust they should feel familiar. So far I'm really enjoying using them but it'd be great to get some external feedback if you have time! https://github.com/amorey/gochan Andres
More dev tools this month
the category →



Open-source GTM skills for technical founders
Dev tools · 29d ago · gtmcofounder.com

OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.
Dev tools · 1d ago · opentrailpaper.com

Launched alongside, April 2023
the whole month →
- G4
Hi HN, Today we’re launching GPT-4 answers on Phind.com, a developer-focused search engine that uses generative AI to browse the web and answer technical questions, complete with code examples and detailed explanations. Unlike vanilla GPT-4, Phind feeds in relevant websites and technical documentation, reducing the model’s hallucination and keeping it up-to-date. To use it, simply enable the “Expert” toggle before doing a search. GPT-4 is making a night-and-day difference in terms of answer quality. For a question like “How can I RLHF a LLaMa model”, Phind in Expert mode delivers a…
AI · 2023 · phind.com



