News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by adhoc_slime on Friday April 29, 2022 @10:37AM (#31205726)
This has perhaps been my biggest pain-point with Golang..

Woe unto those who do not follow the idiosyncrasies of how golang handles versioning, package management, tooling etc.

if this is really your most important part of a language I would whole-heartedly recommend looking at rust which has been a breathe of fresh air in terms of package management and tooling.

Re:Lies we tell ourselves to keep using Golang by busterarm on Friday April 29, 2022 @11:37AM (#31206512)
As an operations person who cares about deploying repeatable systems at scale, Rust's package management (and the toolchain's "packaging" itself) is an absolute nightmare. But at least I with MUSL can I have a 100% statically linked binary, which really should have been easier but that's another argument.

Seriously though, Rust team needs to have its Come To Jesus moment about not piping shit off the internet to sh.

Re:Lies we tell ourselves to keep using Golang by conradludgate on Friday April 29, 2022 @12:22PM (#31207208)
I'm interested if you could elaborate on that?

My company deploys many Rust (web) applications to production and I've not experienced these issues with cargo

Re:Lies we tell ourselves to keep using Golang by busterarm on Friday April 29, 2022 @12:37PM (#31207387)
It's either a problem that you have or you don't, but also one that you have to have a specific mindset to even recognize.

To start off with, please read this: https://lwn.net/Articles/889924/

As you start having to worry about deploying to 10^5 scale machines you want your mindset to be more like the longtime kernel development folks. You want minimal dependencies. You want to build with minimal pulls to the internet. You want repeatable static binaries built from a source tree you can reasonably audit.

At that scale of deployment your "business risk" goes up significantly.

Rust's approach to tooling/packages looks very similar to the Node.js ecosystem. It's a total free for all and dependencies are managed really poorly (in the sense that they grow in number completely out of control).

Re:Lies we tell ourselves to keep using Golang by zozbot234 on Friday April 29, 2022 @01:14PM (#31207947)
You can use cargo vendor to import specific versions of your dependencies into your project for easy auditing, or cargo fetch to simply be more explicit about when to download from remote repositories (when combined with the --offline flag). The typical Rust "dependency" is small; it's more like a single .c or .cxx file than a conventional "library", except that it also plays nice with generic code unlike these languages.
Re:Lies we tell ourselves to keep using Golang by conradludgate on Friday April 29, 2022 @01:18PM (#31208009)
I agree that Rust does suffer a similar problem to NPM where there are many small packages that people will use together.

I do wonder what the solution is though because Go has the same problem as far as I can tell. It has a bigger stdlib so there's less need to reach out. But when you do, you're in the same state with lots of tiny packages that do 1 thing well.

I don't have much experience outside of Go/Rust/Node so I can point to maybe a few languages which I can see being the opposite:

C++ has a large stdlib, and boost. With C++ managing dependencies is your problem so I guess it's easier to have few megapackages.

Python feels the same for mathematical computing. Numpy, TF, Pandas are all huge. Conda is an event bigger bundle, again I think because using the standard pip tools is rather cumbersome and usually not what people want to do

So as far as I can see, it's either easy to share code for others to use, in which case you get dependency hell, or you make it hard to share dependencies, but you have larger more refined ones as a result.

Hard to say what's better

Re:Lies we tell ourselves to keep using Golang by myrrlyn on Friday April 29, 2022 @12:58PM (#31207673)
rustup is available in your package manager's repository
Re:Lies we tell ourselves to keep using Golang by busterarm on Friday April 29, 2022 @01:02PM (#31207755)
No, it isn't. There is a package but it just symlinks to rustc & cargo. You still need to have run the installation manually.

And if you're still running something like CentOS 7, everyone just tells you to go download a Snap for it. eff that.

Re:Lies we tell ourselves to keep using Golang by Thaxll on Friday April 29, 2022 @02:12PM (#31208764)
Go tooling is awesome compared to other language ( Rust included ). Everything is built it and you don't need something external, everything works out of the box dependencies included, it has been the case for 4 years with go mod.

The fact that you can cross compile a win10 .exe on a raspberry pi with a single command as easy as "GOARCH=amd64 GOOS=win go build ." it's very powerful and I don't know a single language that does it out of the box like go does.

Go tooling is one of the strongest point of Go you have all of that built-in:

- compilation

- testing

- benchamark

- dep managment

Re:Lies we tell ourselves to keep using Golang by formerly_proven on Friday April 29, 2022 @02:26PM (#31208940)
> it's very powerful and I don't know a single language that does it out of the box like go does.

zig build -Dtarget=x86_64-windows

Re:Lies we tell ourselves to keep using Golang by Thaxll on Friday April 29, 2022 @02:30PM (#31208978)
I'm talking about mainstream language not stuff in dev. And go has been doing that for 10years+
Re:Lies we tell ourselves to keep using Golang by kristoff_it on Saturday April 30, 2022 @06:17AM (#31214802)
well, not exactly. Zig is also crosscompiling C/C++ code, not just Zig. CGo doesn't do cross-compilation.
Re:Lies we tell ourselves to keep using Golang by jeroenhd on Friday April 29, 2022 @11:57AM (#31206837)
I love Rust as a language but its packaging mechanism is as flawed as all the others. I don't really see what breath of fresh air it brings.

I suppose you can define feature flags in your Cargo.toml but that's about it.

Re:Lies we tell ourselves to keep using Golang by yen223 on Friday April 29, 2022 @11:06AM (#31206105)
Golang has the most hilarious approach to date formatting
Re:Lies we tell ourselves to keep using Golang by lenkite on Friday April 29, 2022 @01:56PM (#31208589)
Lol, I thought it was some sort of Joke when I first learnt it. And kept hunting for the 'proper' way. When I realised this was serious, I banged my head against the wall.
Re:Lies we tell ourselves to keep using Golang by Karrot_Kream on Friday April 29, 2022 @09:10PM (#31212433)
+100. I found a lot of the points in the post pretty silly/arbitrary, but if he had talked about date formatting I would be all aboard.
Re:Lies we tell ourselves to keep using Golang by thegeekpirate on Monday May 02, 2022 @11:10AM (#31236123)
You might enjoy https://golangti.me which I wrote to help with my inability to remember it!