frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Structured Cooperation – A new way of building distributed apps & POC

https://github.com/gabrielshanahan/scoop
2•gabrielshanahan•3h ago
Hey HN,

I wanted to share something I've been working on for the past couple of months, which may be interesting to developers interacting with distributed architectures (e.g., microservices).

I'm a backend developer, and in my 9-5 job last year, we started building a distributed app - by that, I mean two or more services communicating via some sort of messaging system, like Kafka. This was my first foray into distributed systems. Having been exposed to structured concurrency by Nathan J. Smith's beautiful article on the subject (https://vorpus.org/blog/notes-on-structured-concurrency-or-g...), I started noticing the similarities between the challenges of this message-based communication, and that of concurrent programming, and GOTO-based programming before that - actions at a distance, non-trivial tracing of failures, synchronization issues, etc. I started suspecting that if the symptoms were similar, maybe the root cause, and therefore the solution, could be as well.

This led me to design something I'm calling "structured cooperation", which is basically what you get when you apply the principles of structured concurrency to distributed systems. It's something like a "protocol", in the sense that it's basically a set of rules, and not tied to any particular language or framework. As it turns out, obeying those rules has some pretty powerful consequences, including:

- Pretty much eliminates race conditions caused by eventual consistency

- Allows you to recover something resembling distributed exceptions - stack traces and the equivalent of stack unwinding, but across service boundaries

- Makes it much easier to reason about the system as a whole

I put together three articles that explain:

1) what structured cooperation is (https://developer.porn/posts/introducing-structured-cooperat...),

2) one way you could implement it (https://developer.porn/posts/implementing-structured-coopera...), and

3) why it works (https://developer.porn/posts/framing-structured-cooperation/).

I also put together a heavily documented POC implementation in Kotlin, called Scoop (linked in the title). I guess you could call it an orchestration library, similar to e.g. Temporal (https://temporal.io/), although I want to stress that it's just a POC, and not meant for production use.

I was hoping to bounce this idea off the community and see what people think. If it turns out to be a useful way of doing things, I'd try and drive the implementation of something similar in existing libraries (e.g. the aforementioned Temporal, Axon (https://www.axoniq.io/products/axon-framework), etc. - let me know if you know of others where this would make sense). As I mention in the articles, due to the heterogeneous nature of the technological landscape, I'm not sure it's a good idea to actually try to build a library, in the same way as it wouldn't make sense to do a "structured concurrency library", since there are many ways that "concurrency" is implemented. Rather, I tried to build something like a "reference implementation" that other people can use as a stepping stone to build their own implementations.

Above and beyond that, I think that this has educational value as well, and I did my best to make everything as understandable as possible. Some things I think are interesting:

- Implementation of distributed coroutines on top of Postgres

- Has both reactive and blocking implementation, so can be used as a learning resource for people new to reactive

- I documented various interesting issues that arise when you use Postgres as an MQ (see, in particular, https://github.com/gabrielshanahan/scoop/blob/09db323bf6c8a7... and https://github.com/gabrielshanahan/scoop/blob/09db323bf6c8a7...)

Let me know what you think.

Good Management in Invisible

https://emanuele.cc/good-management-in-invisible/
1•gpi•47s ago•0 comments

Elfo – An asynchronous distributed actor framework in Rust

https://github.com/elfo-rs/elfo
1•mmarq•1m ago•0 comments

Show

1•joshi4•1m ago•0 comments

Canadian scientist has risked heat stroke 1k times

https://www.thestar.com/news/canada/this-canadian-scientist-has-risked-heat-stroke-1-000-times-and-upended-what-we-thought/article_8d4b473b-353f-4b4a-a971-15a341e95f05.html
1•Teever•4m ago•0 comments

Scientists find previously unknown record 515-mile-long 2017 lightning strike

https://www.washingtonpost.com/weather/2025/07/31/record-lightning-texas-missouri/
1•bookofjoe•5m ago•1 comments

European countries slam videos of emaciated hostages, call on Hamas to disarm

https://www.timesofisrael.com/european-countries-slam-videos-of-emaciated-hostages-call-on-hamas-to-disarm/
1•mhb•6m ago•0 comments

Show HN: I hand-coded a white-cube-style portfolio website

https://lorie.gallery/
1•ayaros•7m ago•0 comments

Show HN: I made a weekly Spotify Wrapped for your bookmarks

https://tryeyeball.com/
1•quinto_quarto•8m ago•0 comments

Create space-saving clones on macOS with Python

https://alexwlchan.net/2025/cloning-with-python/
1•ingve•9m ago•0 comments

Show HN: Enforce TDD in Claude Code

https://github.com/nizos/tdd-guard
1•Nizoss•12m ago•1 comments

The Day MOOCs Died: Coursera's Preview Mode Kills Free Learning

https://www.classcentral.com/report/coursera-preview-mode-paywall/
2•deepakkarki•14m ago•1 comments

Agentic Web: Weaving the Next Web with AI Agents

https://arxiv.org/abs/2507.21206
1•omarsar•17m ago•0 comments

KDE dev brought XP-Pen Artist 22R Pro support to Linux part of KDE Goals project

https://redstrate.com/blog/2025/07/the-xp-pen-artist-22r-pro-works-on-linux-now/
2•f_r_d•18m ago•0 comments

Time Theft at the Terminal

https://marginalrevolution.com/marginalrevolution/2025/08/time-theft-at-the-terminal.html
3•paulpauper•20m ago•1 comments

Yosemite embodies the long war over US national park privatization

https://theconversation.com/yosemite-embodies-the-long-war-over-us-national-park-privatization-261133
4•rntn•20m ago•0 comments

Real NSFW image generator and editor

https://ai-flux.io/nsfw-ai-image-generator?source=hn
1•victor_cl•20m ago•0 comments

Edge Cases When Founders Interview Founders

https://blog.usv.com/edge-cases
1•wslh•22m ago•0 comments

What Declarative Languages Are

https://semantic-domain.blogspot.com/2013/07/what-declarative-languages-are.html
3•thunderbong•23m ago•0 comments

Wrapper for Cloud providers is in beta

https://nimbus.storage/
1•tsurg•23m ago•0 comments

Debugging Academia: What LaTeX Error Messages Teach Us About Surviving Peers

https://lightcapai.medium.com/debugging-academia-iterative-refinement-for-junior-researchers-933440842d18
1•WASDAai•24m ago•1 comments

What Is a Belief (Part 2: Language, Truth, and Logic)

https://neonomos.substack.com/p/what-is-a-belief-part-2-language
2•paulpauper•29m ago•0 comments

Three Views on Conscoiusness

http://hopefullyintersting.blogspot.com/2025/08/three-views-on-conscoiusness.html
1•paulpauper•29m ago•0 comments

My First Zig Day

https://tristanpemble.com/my-first-zig-day/
1•rvrb•29m ago•0 comments

Study May Undercut Idea That Cash to Poor Families Helps Child Development

https://www.nytimes.com/2025/07/28/us/politics/cash-payments-poor-families-child-development.html
3•superfunny•30m ago•1 comments

Tagasaurus, Tag Your Planet

https://github.com/mantzaris/Tagasaurus
1•avmantzaris•30m ago•1 comments

Censorship is quietly deciding which games you can buy

https://items.gog.com/freedomtobuy/index.html
4•HelloUsername•33m ago•0 comments

UK pornography taskforce to propose banning 'barely legal' content

https://www.theguardian.com/society/2025/aug/03/uk-pornography-taskforce-to-propose-banning-barely-legal-content-after-channel-4-documentary-airs
4•chrisjj•35m ago•2 comments

70% of companies won't survive the next decade: Jason Averbook

https://www.peoplematters.in/article/leadership/70percent-of-companies-wont-survive-the-next-decade-jason-averbook-at-techhr25-42319
1•methuselah_in•36m ago•0 comments

Stanford University and Meta Reality Labs have unveiled revolutionary VR display

https://www.rudebaguette.com/en/2025/08/this-is-the-future-of-vr-tech-breakthrough-0-1-inch-display-delivers-lifelike-3d-images-using-mind-blowing-holography/
1•methuselah_in•37m ago•0 comments

Do no-code users need a way to add custom logic without devs?

1•alphadev_omw•37m ago•1 comments