HackerTrans
TopNewTrendsCommentsPastAskShowJobs

destel

no profile record

Submissions

The "superpower" AI unblocked is ability to ask tons of stupid questions

old.reddit.com
3 points·by destel·24 วันที่ผ่านมา·2 comments

Building what customers need, not just what they ask for

linear.app
2 points·by destel·10 เดือนที่ผ่านมา·1 comments

Developing an AI Agent

dolthub.com
1 points·by destel·10 เดือนที่ผ่านมา·0 comments

The official 2025 Go Developer Survey is live

go.dev
2 points·by destel·10 เดือนที่ผ่านมา·0 comments

Preserving Order in Concurrent Go Apps: Three Approaches Compared

destel.dev
77 points·by destel·10 เดือนที่ผ่านมา·25 comments

comments

destel
·24 วันที่ผ่านมา·discuss
Just be careful with model personalization. Gemini once learned that I'm an engineer and now "translates" all conversations into engineering language, even if we talk about some philosophical stuff
destel
·10 เดือนที่ผ่านมา·discuss
I had similar bad results with gpt 4o/5 when they got these image generation capabilities.

Don’t know what’s the reason: my bad prompting or these models being tuned to work with photos/illustrations only
destel
·10 เดือนที่ผ่านมา·discuss
Some examples are mind blowing. It’s interesting if it can generate web/app designs
destel
·10 เดือนที่ผ่านมา·discuss
You're not late. Just yesterday I've configured new reply notifications via RSS.

Typically function "f" does two things. 1. Performs calculations (this can be parallelized). 2. Writes results somewhere (this must happen sequentially and in the correct order).

Here's the typical OrderedLoop usage example from the article:

  OrderedLoop(in, out, n, func(a A, canWrite <-chan struct{}) {
   // [Do processing here]
   
   // Everything above this line is executed concurrently,
   // everything below it is executed sequentially and in order
   <-canWrite
   
   // [Write results somewhere]
  })

Without the "canWrite" the entire body of the "f" will be executed either concurrently or sequentially. With it - we can have this dual behavior, similar to critical sections protected by mutexes.

It's worth mentioning that OrderedLoop is a low-level primitive. User-level functions like OrderedMap, OrderedFilter and others do not need the "canWrite" channel to be exposed.
destel
·10 เดือนที่ผ่านมา·discuss
Thanks. This replyTo pattern is very similar to promises in other languages.
destel
·10 เดือนที่ผ่านมา·discuss
UPD.

I've just made a small but important clarification to the article. While in many cases it's easier and even preferred to calculate all results, accumulate them somewhere, then sort; this article focuses on memory bound algorithms that support infinite streams and backpressure.
destel
·10 เดือนที่ผ่านมา·discuss
I've just made a small but important clarification to the article. While in many cases it's easier and even preferred to calculate all results, accumulate them somewhere, then sort; this article focuses on memory bound algorithms that support infinite streams and backpressure.
destel
·10 เดือนที่ผ่านมา·discuss
Wow, that’s some seriously sophisticated stuff - it’s not that often you see a heap used in typical production code (outside of libraries)!

Your first example definitely gives me merge-sort vibes - a really clean way to keep things ordered across multiple sources. The second and third scenarios are a bit beyond what I’ve tackled so far, but super interesting to read about.

This also reminded me of a WIP PR I drafted for rill (probably too niche, so I’m not sure I’ll ever merge it). It implements a channel buffer that behaves like a heap - basically a fixed-size priority queue where re-prioritization only happens for items that pile up due to backpressure. Maybe some of that code could be useful for your future use cases: https://github.com/destel/rill/pull/50
destel
·10 เดือนที่ผ่านมา·discuss
I haven’t used Java for about a decade, so I’m not very familiar with streams api.

Your snippet looks good and concise.

One thing I haven’t emphasized enough in the article is that all algorithms there are designed to work with potentially infinite streams
destel
·10 เดือนที่ผ่านมา·discuss
Hi everyone, I’m the author of the article. Happy to answer any questions or discuss concurrency patterns in Go. Curious how others tackle such problems.