Live data from Hacker News

Go 1.24's go tool is one of the best additions to the ecosystem in years

jvt.me

191–200 of 207 posts

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#191
post #125

Earlier quoted context omitted.

But this just doesn't match my experience with Blaze at all. For my internal usage with C++ & Go it's perfect. For the weird niche use case of building and packaging BPF programs (with no support from the central tooling teams, we had to write our own macros) it still just works. For Python where it's a poor fit for the language norms it's a minor inconvenience but still mostly stays out of the way. I hear Java is si…

I count C++ projects in the "worst" bucket, where every project has its own build system, its own structure, own way to run tests, own way to configure features, own way to generate docs. So if a build system works great for your mixed C++ projects, your build system is taking on the maximum complexity to deal with it, and that's the complexity I don't want in non-C++ projects. When I work with pure-JS projects, or p…

No I'm not talking about mixed projects (although the ability to do that is very important).

I'm saying that using it for separate C++ and Go projects is extremely convenient and ergonomic.

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#192
post #93

I think it's a bad addition since it pushes people towards a worse solution to a common problem. Using "go tool" forces you to have a bunch of dependencies in your go.mod that can conflict with your software's real dependency requirements, when there's zero reason those matter. You shouldn't have to care if one of your developer tools depends on a different version of a library than you. It makes it so the tools them…

I ask this out of curiosity, not accusation, do you work for Flox? Can't say I've ever seen it mentioned "in the wild".

I do not, just aware of it as a hip tool in the general space of "I want to install and version tools per-project, but I don't want to learn the nix programming language"

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#193

I wish Go Team would focus on performance rather thann adding new features that nobody asked for. The http stack is barely able to beat NodeJS these days, ffs.

The Go HTTP stack is not optimized for raw performance though; there's a number of alternative HTTP stacks written in Go optimized for performance, like fasthttp ( https://github.com/valyala/fasthttp ). (source: https://www.techempower.com/benchmarks/ ) Likewise, the standard library NodeJS http stack will not be as performant as a performance optimized alternative. That said, if raw performance is your primary conce…

Agreed on fasthttp.

> There's many more factors to consider.

Erlang / Elixir?

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#194
post #135

Since i started using nix devShells this is kind of useless. What if i have 1 tool that isn't go tool so what do i do with it? so i have that one "exception" and here we go again...

And why is that tool always protoc?

Yeah you are right :) i mean i could use buf build but i think the problem is just more general.

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#195
post #189
post #163

Earlier quoted context omitted.

Go has been a masterclass in disparaging industry learnings as "unnecessary" (dep management, generics, null safety), then gradually bolting them into the language. It's kinda hilarious to watch.

It would be, if they didn't hit jackpot with Docker and Kubernetes adoption, and now many of us on DevOps space have to deal with it in some form. A bit like C ignoring previous experience in safe systems, getting lucky with UNIX's adoption, and we are still trying to fix that to this day.

[deleted]

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#196
post #132

Earlier quoted context omitted.

Tbh, I think you missed this part: "[..] mixed with artefact dependencies itself".

An artifact depends on the tools used to build it. This is why we pin versions. Go tool is common sense, allowing for any old tool version in the build chain invites failure.

I'm not debating that. I'm pointing out, that the person replied to, said there's no reason to mix it together with the artifact dependencies.

In other words, no need to mix "dependencies" and "dev dependencies" together.

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#197

Earlier quoted context omitted.

What's the use case you have over "just" using the official install process (`curl | sh`)?

As long as a team agrees to have .golangci-version as the source of truth, the people using the tool don't have to worry about having the right version installed, as the wrapper fetches it on demand. Having the wrong version installed between collaborators is problematic as then they may get different results and spend time wondering why. Works across branches and projects.

A simpler approach is to use `go run` with a specific version. e.g.:

    go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 run
Easy enough to stuff in a Makefile or whatever.

Even better in Go 1.24 since according to this article the invocations of go run will also be cached (rather than just utilizing the compilation cache.) So there shouldn't be much of an advantage to pre-emptively installing binaries anymore versus just go running them.

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#198

Earlier quoted context omitted.

There is a cache and they're aren't re-compiled unless they change or the cache is cleared.

cached* as of Go 1.24, prior to that they were re-compiled each time

Ok, I'm trying to suss out what this means, since `go tool` didn't even exist before 1.24.

The functionality of `go tool` seems to build on the existing `go run` and the latter already uses the same package compilation cache as `go build`. Subsequent invocations of `go run X` were notably faster than the first invocation long before 1.24. However, it seems that the final executable was never cached before, but now it will be as of 1.24. This benefits both `go run` and `go tool`.

However, this raises the question: do the times reported in the blog reflect the benefit of executable caching, or were they collected before that feature was implemented (and/or is it not working properly)?

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#199

Earlier quoted context omitted.

Ah, thanks. This isn't much of an upgrade from the `tools.go` convention, where the tools are underscore-imported. All it does is provide an indication in the `go.mod` file that some dependencies come from tools. Plus, `go tool ` is slower than `./bin/ `. Not to mention, it doesn’t resolve the issue where tools might use a different version of a dependency than the app.

go tool is only slower when (re-)compilation is needed, which is not often. You'd have to pay the same price anyway at some point to build the binary placed in ./bin.

I'm actually not 100% on this; there is a cache, and it should speed things up on subsequent runs, but maybe not as much as one might think: https://news.ycombinator.com/item?id=42864971

Re: Go 1.24's go tool is one of the best additions to the ecosystem in years

#200
post #93

I think it's a bad addition since it pushes people towards a worse solution to a common problem. Using "go tool" forces you to have a bunch of dependencies in your go.mod that can conflict with your software's real dependency requirements, when there's zero reason those matter. You shouldn't have to care if one of your developer tools depends on a different version of a library than you. It makes it so the tools them…

> Using "go tool" forces you to have a bunch of dependencies in your go.mod No, it doesn't. You can use "go tool -modfile=tools.mod mytool" if you want them separate.

That seems like it should have been the default
Post reply on HN