HackerTrans
トップ新着トレンドコメント過去質問紹介求人

destel

no profile record

投稿

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

old.reddit.com
3 ポイント·投稿者 destel·24 日前·2 コメント

Building what customers need, not just what they ask for

linear.app
2 ポイント·投稿者 destel·10 か月前·1 コメント

Developing an AI Agent

dolthub.com
1 ポイント·投稿者 destel·10 か月前·0 コメント

The official 2025 Go Developer Survey is live

go.dev
2 ポイント·投稿者 destel·10 か月前·0 コメント

Preserving Order in Concurrent Go Apps: Three Approaches Compared

destel.dev
77 ポイント·投稿者 destel·10 か月前·25 コメント

コメント

destel
·24 日前·議論
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 か月前·議論
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 か月前·議論
Some examples are mind blowing. It’s interesting if it can generate web/app designs
destel
·10 か月前·議論
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 か月前·議論
Thanks. This replyTo pattern is very similar to promises in other languages.
destel
·10 か月前·議論
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 か月前·議論
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 か月前·議論
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 か月前·議論
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 か月前·議論
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.