News for hackers. Stuff that matters.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by wokwokwok on Thursday November 28, 2024 @06:39PM (#42269458)
It’s not a technical thing.

It’s not bad.

It’s a misguided community thing.

Cgo is the correct choice for many domains (ui, gamedev, systems stuff) where you can’t use a network boundary as your “interacts with other languages”.

The language is opinionated; it’s not good at playing with others. It’s good at other things (network services, etc)… but you can and it’s not bad.

…it’s just hard, and people don’t like hard things.

Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by AYBABTME on Thursday November 28, 2024 @08:50PM (#42270111)
It can be slower than pure Go options in some scenarios.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by wokwokwok on Thursday November 28, 2024 @10:29PM (#42270554)
Purego is ffi and is slower than cgo.

That library (like this) claim “no cgo” when they use ffi is just ridiculous.

This one is particularly egregious in even supporting cgo!

Pure go my ass. You’re invoking c functions. It’s not pure go.

The distinction is in the tool chain; cgo is a better, first party solution.

Purego is an unstable (it is, read the repo!) workaround for people who a) don’t like the word “cgo” or b) dont like having a c tool chain.

…but realistically you have to interop with c code in many domains.

Sure, a pure world is great, but that’s not always possible.

People who don’t like cgo and choose purego are doing it for, mostly, optics (cgo is bad! This isn’t cgo… it’s ffi… totally different) and appear to fail to appreciate the technical distinction more complicated than they imagine, and they are still using c.

Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by paride5745 on Friday November 29, 2024 @03:04AM (#42271926)
Cgo in server projects makes using Alpine as a base a headache honestly.

If I can I always pick pure Go solutions just for this reason.