Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Goroutines and Cells: Lessons in Goal-Directed ...

Goroutines and Cells: Lessons in Goal-Directed Systems

This talk explores a new way to approach concurrency in Go by drawing inspiration from bioelectric signaling in cells. It contrasts how biological systems achieve scalable, decentralized coordination with traditional concurrency patterns such as worker pools and fixed-rate limiters, which often struggle to adapt to dynamic workloads.

Biological systems use graded communication, rhythmic synchronization, and localized interactions to coordinate without centralized control. By applying these principles to Go concurrency, developers can design adaptive, nature-inspired systems that improve efficiency, fault tolerance, and self-organization.

Through conceptual models and real-world analogies, this talk will illustrate:

How graded signaling enables dynamic resource allocation, reducing bottlenecks in goroutine coordination
How rhythmic synchronization helps orchestrate periodic tasks more efficiently than independent timers
How decentralized interactions lead to emergent consensus without centralized control

Attendees will leave with new mental models for designing concurrent systems, gaining insights into how nature-inspired approaches can make Go applications more resilient and scalable.

Avatar for Carlisia Campos

Carlisia Campos

August 27, 2025
Tweet

More Decks by Carlisia Campos

Other Decks in Programming

Transcript

  1. The idea • Geek out on biology • Learn that

    cells PURSUE GOALS, what • Have epiphany • Don’t goroutines pursue goals too? • Or do they? Could they?
  2. Goal-directedness • Individual cells at the wound site detect: "Wrong

    morphology here!" • Each cell pursues a local goal based on bioelectric gradients (not DNA!) • Collectively, their local goals achieve the organism-level result When a salamander loses its leg: Result: Complete leg emerges from cells pursuing local goals!
  3. Goroutines and Cells? • Go concurrency gives goroutines instructions •

    But what if we we gave goroutines goals instead? • So… I did that!
  4. whoami • Go since 2016 • Co-founding member of Gobridge

    • GoTime Podcast OG co-host • Kubernetes + Cloud Native + Open Source • Currently geeking out on MCP servers • @carlisia
  5. Three things • Research that inspired this work • Emerge:

    a Go library for goal-directed synchronization • Show how you can use Emerge doing a live simulation
  6. Why this is for you • New mental model: using

    goroutines as goal-seeking agents • Optimize timing/synchronization tasks without adding infrastructure • Measure coherence gaps in your concurrent or distributed systems
  7. Emerge: goal-based, collective problem-solving Intelligence is a fixed goal with

    variable means of achieving it. — William James The father of American psychology
  8. Dr. Michael Levin Paper: Synchronization of Bioelectric Oscillations in Networks

    of Nonexcitable Cells: From Single-Cell to Multicellular States Paper Bioelectric signaling: Reprogrammable circuits underlying embryogenesis, regeneration, and cancer
  9. • Decentralized synchronization algorithm • Based on the Kuramoto model

    from physics. • Enables independent agents to achieve coordinated behavior through local interactions • No central control • Inspired by biological synchronization phenomena
  10. TW!

  11. We covered Dr. Michael Levin’s research, the source of inspiration

    for Emerge Add action item Add action item Add action item
  12. Next Actions Read docs: alternatives, algorithm, concepts, quick start, security,

    etc (optional) Instal emerge: go get github.com/carlisia/bio-adapt/emerge Add literally 5 lines: client := emerge.MinimizeAPICalls(scale.Small) // For batching as a goal client.Start(ctx) if client.IsConverged() { // Your existing batch logic }
  13. Next Actions And monitor coherence: // Monitor convergence s, err

    := swarm.New(scale.Large, goal) ... go func() { ticker := time.NewTicker(100 * time.Millisecond) defer ticker.Stop() for { select { case <-ticker.C: if s.MeasureCoherence() >= 0.85 { close(done) return } case <-ctx.Done(): return } } }()
  14. 🖇 Glue Gophers detectives pooling clues together 🧭 Navigate Gophers

    navigating and finding paths together 🧲 Emerge Synchronized Gophers moving together One more thing
  15. 🖇 Glue Gopher detectives pooling clues together 🧲 Emerge Synchronized

    Gophers moving together 🧭 Navigate Gophers navigating and finding paths together One more thing
  16. Next Actions 🧲 Explore whether biological principles can fundamentally change

    how we build distributed sysems Try emerge. Break it. Fix it. Tell me about it. Give feedback: it is the evolution pressure that will make these primitives thrive or die Contribute!
  17. THANKS! Carlisia Campos / Gophercon NYC, 2025 @carlisia https://grokkigtech.io 🧲

    Try emerge today: https://github.com/carlisia/bio-adapt ⚡ Watch for Navigate: Next 🔗 Dream about Glue: What should systems discover together? gc25{8e95cef2-1541-4308-9e14-f61c8d96288a}