frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Credential Exchange Format publishes version 1.0

https://fidoalliance.org/specs/cx/cxf-v1.0-ps-20250814.html
1•shellcromancer•2m ago•0 comments

8 Women, 4 Bedrooms and 1 Cause: Breaking A.I.'s Glass Ceiling

https://www.nytimes.com/2025/08/23/business/ai-female-hackers-foundher-house.html
1•mistersquid•2m ago•0 comments

YouTube steps up fight against ad blockers again

https://www.ghacks.net/2025/06/09/googles-fight-against-ad-blockers-on-youtube-enters-another-round/
1•nsdfg•3m ago•0 comments

Northrop Grumman B-21 Raider

https://en.wikipedia.org/wiki/Northrop_Grumman_B-21_Raider
1•ustad•6m ago•0 comments

CoalescingMergeTree Table Engine in ClickHouse

https://clickhouse.com/blog/clickhouse-25-6-coalescingmergetree
1•saisrirampur•6m ago•0 comments

"Find my age" puzzles

https://mathwithbaddrawings.com/2025/02/03/find-my-age-puzzles-but-with-all-true-facts/
1•ustad•8m ago•0 comments

I Found My Lost Earbud in Nature

https://cubiclenate.com/2025/08/23/epic-earbud-recovery-earbud-finder/
1•LorenDB•9m ago•0 comments

uBlock Origin will stop working in Chrome 142 with Manifest V2 removal

https://old.reddit.com/r/uBlockOrigin/comments/1mtowwf/end_of_support_for_ubo_on_chrome_chromium/
1•nsdfg•9m ago•0 comments

Ask HN: Anyone have experience renting cloud GPUs?

2•chosewon•9m ago•2 comments

Trump's New "Apple Store"

https://www.axios.com/2025/08/23/gebbia-chief-design-officer-airbnb
1•FireBeyond•10m ago•1 comments

Will at centre of legal battle over Shakespeare’s home unearthed after 150 years

https://www.theguardian.com/culture/2025/aug/21/will-at-centre-of-legal-battle-over-shakespeares-...
2•forthelose•16m ago•0 comments

Why Was Apache Kafka Created?

https://bigdata.2minutestreaming.com/p/why-was-apache-kafka-created
2•mpweiher•17m ago•0 comments

Chrome 142 will drop support for pre-Skylake CPUs without AVX2

https://support.google.com/chrome/thread/330567882/important-update-google-chrome-cpu-compatibili...
2•nsdfg•17m ago•0 comments

The F-35 Is Losing the (Trade) War

https://www.jalopnik.com/1945910/f-35-fighter-jet-losing-trade-war/
9•rntn•20m ago•1 comments

Anybody using multi-seat? This is my Ubuntu 24.04 multi-seat setup for my kids

https://old.reddit.com/r/Ubuntu/comments/1mxcn6w/anybody_using_multiseat_this_is_my_ubuntu_2404/
2•taubek•22m ago•0 comments

Drawnix – open-source whiteboard tool for drawing mind map, flowchart, freehand

https://github.com/plait-board/drawnix
1•maxloh•23m ago•0 comments

The Epic Rise and Fall of a Dark-Web Psychedelics Kingpin

https://www.wired.com/story/rise-fall-dark-web-psychedelics-kingpin-dmt/
1•paulpauper•23m ago•0 comments

Microdot: The impossibly small web framework for Python and MicroPython

https://github.com/miguelgrinberg/microdot
2•Bogdanp•24m ago•0 comments

SurrealDB is sacrificing data durability to make benchmarks look better

https://blog.cf8.gg/surrealdbs-ch/
1•ummonk•27m ago•0 comments

Norco prison will close as inmate population declines

https://www.latimes.com/california/story/2025-08-05/norco-riverside-county-prison-to-close-fall-2026
2•PaulHoule•29m ago•1 comments

Protests as Greenlandic woman's newborn taken after 'parenting competence' tests

https://www.theguardian.com/world/2025/aug/23/protests-as-newborn-removed-from-greenlandic-mother...
4•Geekette•29m ago•2 comments

Toyota Is Recycling Old EV Batteries to Help Power Mazda's Production Line

https://www.thedrive.com/news/toyota-is-recycling-old-ev-batteries-to-help-power-mazdas-productio...
2•computerliker•30m ago•0 comments

Sci-Hub Now Blocked in India

https://spicyip.com/2025/08/sci-hub-now-completely-blocked-in-india.html
2•elashri•31m ago•1 comments

The School for Poetic Computation

https://sfpc.study/
1•brianzelip•32m ago•0 comments

Meta to unveil Hypernova smart glasses with a display, wristband next month

https://www.cnbc.com/2025/08/22/meta-hypernova-ar-glasses-wristband.html
1•marc__1•36m ago•0 comments

Help flight radar with a RasPi and SDR

https://www.flightradar24.com/build-your-own
5•sebzuddas•45m ago•0 comments

America Once Used Concrete Arrows to Direct Pilots

https://skipboring.com/america-once-laid-down-giant-concrete-arrows-to-tell-pilots-where-to-go-an...
1•foota•45m ago•0 comments

The administration's big Intel investment comes from already awarded grants

https://techcrunch.com/2025/08/23/the-trump-administrations-big-intel-investment-comes-from-alrea...
2•rntn•46m ago•0 comments

Embedding Wren in Hare

https://drewdevault.com/2025/08/20/2025-08-20-Hare-and-Wren.html
1•ingve•49m ago•0 comments

Ask HN: What can I do to fight internet censorship in Spain as a non-EU citizen?

2•PutaXavier•51m ago•1 comments
Open in hackernews

Waitgroups: What they are, how to use them and what changed with Go 1.25

https://mfbmina.dev/en/posts/waitgroups/
49•mfbmina•3h ago

Comments

nikolayasdf123•3h ago
> wg := sync.WaitGroup{}

just `var wg sync.WaitGroup`, it is cleaner this way

mr90210•2h ago
Oh you are one of those. The nit picker. This is not at a PR review mate.
nikolayasdf123•2h ago
"one of those", name calling, telling me what to say,

cool it down a little. touch some grass. and hopefully you will see beauty in Go zero-values :P

dwb•2h ago
Why?
nikolayasdf123•2h ago
zero value. container-agnostic initialization. say your type is not struct anymore, you would not have to change the way you intialize it. what you care here is zero value, and let the type figure out that it is zero and use methods appropriately. and it is just more clean this way

here is google guideline: https://google.github.io/styleguide/go/best-practices#declar...

dwb•2h ago
That is a much better argument than saying it is "more clean", which doesn't mean anything. I don't necessarily agree, because I don't think zero values are a good feature of the language, and even if they were this is a completely trivial case. But at least I don't have to work out what "cleanliness" is.
fozdenn•2h ago
doesn't this point to a bigger problem that there are two ways of doing the same thing?
nikolayasdf123•2h ago
no. it is different thing. container-agnostic zero value vs struct init.
stefanos82•3h ago
Personally I wished they had it backported to previous versions too, because it's rather convenient!

What is quite sad is that we cannot add it ourselves as it's so simple of what they have done:

    func (wg *WaitGroup) Go(f func()) {
        wg.Add(1)
        go func() {
            defer wg.Done()
           f()
        }()
    }
cedws•3h ago
You can wrap WaitGroup if you really want to.
stefanos82•3h ago
Can you provide an example please?
listeria•2h ago
something like this would do it:

  package main
  
  import (
    "sync"
    "time"
  )
  
  type WaitGroup struct {
    sync.WaitGroup
  }
  
  func (wg *WaitGroup) Go(fn func()) {
    wg.Add(1)
    go func() {
      defer wg.Done()
      fn()
    }()
  }
  
  func main() {
    var wg WaitGroup
    wg.Go(func() { time.Sleep(1 * time.Second) })
    wg.Wait()
  }
stefanos82•2h ago
This is really amazing, thank you so much!
listeria•2h ago
It's called struct embedding, there an article about it in Go by Example if you're interested: https://gobyexample.com/struct-embedding
stefanos82•1h ago
Thank you @listeria, today I learned about struct embedding lol!
genghisjahn•52m ago
I rediscover this about once a year and am always so happy when I do.
evanelias•3h ago
You can just use golang.org/x/sync/errgroup instead, which has always provided this style of use.

errgroup also has other niceties like error propagation, context cancellation, and concurrency limiting.

porridgeraisin•2h ago
errgroup cancels the whole task if even one subtask fails however. That is not desirable always.
Groxx•1h ago
It does not, which is easy to verify from the source. Every func passed in is always run (with the exception of TryGo which is explicitly "maybe").

At best, using the optional, higher-effort errgroup.WithContext will cancel the context but still run all of your funcs. If you don't want that for one of the funcs, or some component of them, just don't use the context.

evanelias•17m ago
If the context cancellation is undesirable, you just choose not to use WithContext, as the sibling comment mentions.

You could also just make your subtask function return nil always, if you just want to get the automatic bookkeeping call pattern (like WaitGroup.Go from Golang 1.25), plus optional concurrency limiting.

Also note, even if a subtask function returns an error, the errgroup Wait blocking semantics are identical to those of a WaitGroup. Wait will return the first error when it returns, but it doesn't unblock early on first error.

Cyph0n•1h ago
Context cancellation is not always desirable. I personally have been bitten multiple times by the default behavior of errgroup.
CamouflagedKiwi•40m ago
You have to explicitly propagate the group's context if you want it to cancel. You can just not do that if you don't want - there certainly are cases for that.
CamouflagedKiwi•35m ago
They basically don't backport anything for Go, but the quid pro quo for that is that the backwards compatibility is pretty strong so upgrades should be safe. I have seen one serious issue from it, but still it's the language I'm the most confident to do an upgrade and expect things to Just Work afterwards.
porridgeraisin•2h ago
Love this. Majority of concurrency in a usual web service is implemented using waitgroups IME (see below) This will greatly simplify it.

  var wg sync.WaitGroup
  wg.Add(1)
  go func(){
    callService1(inputs, outParameter)
    wg.Done()
  }
  // Repeat for services 2 through N
  wg.Wait()
  // Combine all outputs

BTW, this can already be done with a wrapper type

  type WaitGroup struct { sync.WaitGroup }

  func (wg *WaitGroup) Go(fn func()) {
    wg.Add(1)
    go func() {
      fn()
      wg.Done()
    }()
  }
Since you're doing struct embedding you can call methods of sync.WaitGroup on the new WaitGroup type as well.
a-poor•2h ago
This means you can't pass variables in as function arguments. Even the example in the official go docs doesn't handle the scope correctly:

  func main() {
   var wg sync.WaitGroup
   var urls = []string{
    "http://www.golang.org/",
    "http://www.google.com/",
    "http://www.example.com/",
   }
   for _, url := range urls {
    // Launch a goroutine to fetch the URL.
    wg.Go(func() {
     // Fetch the URL.
     http.Get(url)
    })
   }
   // Wait for all HTTP fetches to complete.
   wg.Wait()
  }
https://pkg.go.dev/sync#example-WaitGroup

You need to use this pattern instead:

   for _, url := range urls {
    url := url
    // ...
jeremyloy_wt•1h ago
This isn’t necessary anymore as of Go 1.22

https://go.dev/blog/loopvar-preview

9rx•1h ago
> This means you can't pass variables in as function arguments.

Well, you could...

    for _, url := range urls {
        wg.Go(func(u string) func() {
            return func() {
                http.Get(u)
            }
        }(url))
    }
> You need to use this pattern instead

Why? Seems rather redundant. It is not like WaitGroup.Go exists in earlier versions.

danenania•1h ago
I like WaitGroup as a concept, but I often end up using a channel instead for clearer error handling. Something like:

  errCh := make(chan error)
  for _, url := range urls {
    go func(url string){
      errCh <- http.Get(url)
    }(url)
  }

  for range urls {
    err := <-errCh
    if err != nil {
      // handle error
    }
  }
Should I be using WaitGroup instead? If I do, don't I still need an error channel anyway—in which case it feels redundant? Or am I thinking about this wrong? I rarely encounter concurrency situations that the above pattern doesn't seem sufficient for.
javier2•1h ago
How you handle err here? If you return, the go routines will leak
danenania•39m ago
Ah, good point—should be using a buffered channel to avoid that:

  errCh := make(chan error, len(urls))
c0balt•51m ago
You would probably benefit from errgroup, https://pkg.go.dev/golang.org/x/sync/errgroup

But channels already do the waiting part for you.

danenania•23m ago
Thanks! looking into errgroup
tombert•16m ago
Forgive a bit of ignorance, it's been a bit since I've touched Go, but this looks awfully similar to a Java CountdownLatch [1]. Is this just a glorified Go port of that or am I missing something vital here?

[1] https://docs.oracle.com/javase/8/docs/api/java/util/concurre...