News for hackers. Stuff that matters.
Re:More powerful Go execution traces by bsaul on Thursday March 14, 2024 @07:39PM (#39710331)
i've sometimes heard that the JVM had best in class tooling for server troubleshooting. How does go compare to it now ?
Re:More powerful Go execution traces by Thaxll on Thursday March 14, 2024 @07:57PM (#39710481)
Go is one of the best language in term of tooling, it has just one binary that contains everything, I don't know any other language that includes out of the box all of that:

- testing

- benchmark

- profiling

- cross compilation ( that work from any platform, like compiling a windows .exe from your raspberry pi for example )

- some linting

- documentation

- package mgmt

- bug report

- code generation

- etc...

Java is probably more advanced in some fields ( like tracing / profiling ) but it lacks others.

Re:More powerful Go execution traces by preommr on Thursday March 14, 2024 @08:50PM (#39710895)
Golang also has some of the worst tooling because everything is based off of what comes builtin, and because they're not specialized projects, they're very limited in capability and configuration.

Coming from ts, tooling like tsconfig has a lot of options, but sensible defaults can be set with a single flag like strict mode. If some org has some specialized needs, they can dive into the configuration and get what they need.

With golang, not only would it be a lot for any single team to offer all those features at a decent level of polish, the golang culture in particular is very, very resistant to small bits of comfort because of dogma like "worse is better". It's kind of similar to Haskell's "avoid success at all cost".

Re:More powerful Go execution traces by dilyevsky on Thursday March 14, 2024 @09:04PM (#39711010)
I can’t believe we’re seriously comparing go polished tooling with bloatware and half baked crap in the js/ts land especially when it comes to package management and such.

Also there’s a lot of go tooling that doesn’t come from go team itself because go standard library exposes first class code introspection utilities. go vet is an example of this

Re:More powerful Go execution traces by icholy on Thursday March 14, 2024 @10:24PM (#39711447)
Why spend your time coding when you could be fiddling with configuration files all day? I love re-learning how to make package.json, tsconfig, esbuild, eslint, prettier, mocha and webpack play nice every time I start a new project.
Re:More powerful Go execution traces by klabb3 on Thursday March 14, 2024 @11:08PM (#39711678)
Missing peer dependency. Have you tried nuking your node_modules?
Re:More powerful Go execution traces by mickael-kerjean on Friday March 15, 2024 @07:31AM (#39714345)
No I'm busy upgrading webpack and rewriting all my tests from jest to vitest
Re:More powerful Go execution traces by badrequest on Thursday March 14, 2024 @10:26PM (#39711457)
I've been involved in the Go community for almost 10 years, and I've never once heard anybody say "worse is better". Comparing Go's tooling to Typescript feels like a farce, especially since you've neglected to mention the horror that is npm.
Re:More powerful Go execution traces by cdelsolar on Thursday March 14, 2024 @10:35PM (#39711507)
No?
Re:More powerful Go execution traces by Thaxll on Thursday March 14, 2024 @08:53PM (#39710921)
Which tools are you talking about?
Re:More powerful Go execution traces by BillyTheKing on Friday March 15, 2024 @01:44AM (#39712398)
This is a classic example of a 'contrarian' take for what feels like the sake of it. TS/JS tooling is a total and utter disaster at this point.

The commonJS/module transition is a nightmare. The fact that something like 'prisma' exists - a c-written 'query engine' that turns prisma js into sql.. wut?

This ecosystem is on a highway to hell literally.. I really hope Bun works out, because I do like Typescript, I do like programming in it - but I'm absolutely done with spending hours upon hours figuring out configs in tsconfig, jest, package.json eslintrc, prettier, vstest and whatever the next 'new' abstraction is. In Go I can just focus on the code and forget about the rest

Re:More powerful Go execution traces by random_mutex on Friday March 15, 2024 @02:23AM (#39712575)
TS tooling excels at preventing you from getting work done
Re:More powerful Go execution traces by Cthulhu_ on Monday March 18, 2024 @06:28AM (#39742180)
TSConfig having a lot of options isn't a selling point though; you shouldn't need any of those. That said, the flags and strict mode are intended for when you have an existing "sloppy" JS codebase or mindset.

You shouldn't need anything (except strict mode) in a new TS project.

That said, TS is quickly becoming the antithesis of what Go tries; every release for the past few years I've seen now are all features where I'm like, "I will never need or use this". Some conveniences have been improved on - like better type inference - but that will mainly allow for cleaning up workarounds.

"some orgs with specialised needs" are going to be legacy projects, either older TS versions that didn't have the features that it does now, or JS codebases. This isn't generally an issue with Go projects, most of which are greenfield. That said, there's some X to Go conversion projects that produce less than ideal code though, like usage of the `interface{}` type that at this point is a code smell.

Re:More powerful Go execution traces by pjmlp on Friday March 15, 2024 @02:04AM (#39712492)
There is really nothing in Go that Java ecosystem lacks, in their 30 years of existence.

The only thing one could arguably argue that Go does better is value types, but even that requires careful coding so that escape analysis is triggered, and in that sense, it is only a matter to use a JVM implementation like GraalVM, OpenJ9, Android ART, PTC, Aicas, Azul.

Re:More powerful Go execution traces by Alifatisk on Friday March 15, 2024 @11:00AM (#39716519)
> single binary

> cross compilation ( that work from any platform, like compiling a windows .exe from your raspberry pi for example )

This, I think is one of Go's best selling point.

Re:More powerful Go execution traces by Xeoncross on Thursday March 14, 2024 @07:46PM (#39710389)
For good reason, the JVM has a ton more knobs that need adjusting. You can't just run Java code. The JVM has a lot of tricks you have to customize for based on your workload.

For years until 1.19 the Go GC has had only one tuning parameter (GOGC).

Re:More powerful Go execution traces by rileymichael on Thursday March 14, 2024 @08:35PM (#39710764)
I don't see the connection you're making between knobs that adjust runtime behavior and tooling. As an aside, "you can't just run java code" is a bit hyperbolic, plenty of people "just run" java apps and rely on the default ergonomics. The modern JVM also offers more automated options, such as ZGC which is explicitly self tuning.
Re:More powerful Go execution traces by iamcalledrob on Friday March 15, 2024 @05:48AM (#39713779)
With Go, you never spend hours/days debugging broken builds due to poorly documented gradle plugins. As an example :)

You really, truly, just run.

Re:More powerful Go execution traces by pjmlp on Friday March 15, 2024 @07:51AM (#39714499)
That is the problem right there, using Gradle without having learned why no one uses Ant any longer.

As for Go, good luck doing just run when a code repo breaks all those URL hardcoded in source code.

Re:More powerful Go execution traces by philosopher1234 on Friday March 15, 2024 @11:10AM (#39716627)
That’s not a real issue:

* the go module proxy ensures repos are never deleted, so everything continues to work

* changing to a new dep is as easy as either a replace directive or just find and replace the old url

Re:More powerful Go execution traces by pjmlp on Friday March 15, 2024 @02:17PM (#39718947)
It requires work to keep things working, exactly the same thing.
Re:More powerful Go execution traces by philosopher1234 on Saturday March 16, 2024 @04:53AM (#39724317)
The module proxy is used by default and requires no work. I don’t think what you’re saying makes much sense.
Re:More powerful Go execution traces by pjmlp on Saturday March 16, 2024 @08:28AM (#39725331)
So there is some magic pixie dust that will fix url relocations for the metadata used by the proxy, without having anyone touch its configuration?
Re:More powerful Go execution traces by philosopher1234 on Saturday March 16, 2024 @01:20PM (#39727701)
I think I’m missing something, because I’m pretty sure you understand the go module proxy (having seen you around here before) but I really don’t understand what problem you’re talking about.

If a module author deletes or relocates their module, the old module is not deleted or renamed from the module proxy. It is kept around forever. Code that depends on it to not break does not break.

If they relocated and you want to update to the new location, perhaps for bug fixes, then you do have to do a bit extra work (a find and replace, or a module level replace directive) but it’s a rare event and generally a minor effort, in my opinion, so I don’t think this is a significant flaw.

For most users most of the time they don’t need to think about this at all.

Re:More powerful Go execution traces by badrequest on Friday March 15, 2024 @03:19PM (#39719655)
> good luck doing just run when a code repo breaks all those URL hardcoded in source code

You're on a tear in this thread being wrong about how Go works, but I'm really curious what extremely specific series of events you're imagining would have to happen to lead to this outcome. If I use a dependency, it gets saved in the module proxy, I can also vendor it. You would have to, as a maintainer, deliberately try to screw over anybody using your library to accomplish what you describe.

Re:More powerful Go execution traces by pjmlp on Friday March 15, 2024 @03:55PM (#39719993)
Not when one git clones an existing project, only to discover the hardcoded imports are no longer valid.

Being a mantainer has nothing to do with some kind of gentlemens code of condut.

Re:More powerful Go execution traces by tsimionescu on Friday March 15, 2024 @01:53AM (#39712444)
Note that Go needs those knobs just as much as the JVM does, at least some of them. They just didn't want to expose them.
Re:More powerful Go execution traces by philosopher1234 on Friday March 15, 2024 @11:11AM (#39716638)
Which knobs does go need?
Re:More powerful Go execution traces by tsimionescu on Friday March 15, 2024 @12:01PM (#39717245)
Fine-grained control over various GC phases and decisions (such as the level of parallelism, max pause times). Until Go 1.19, it was even missing a max memory limit, and even now it only has a soft memory limit.

Additionally, of course it would be nice to have more GC options, such as choosing between a throughput-oriented GC design and a latency-oriented one, having the option of a compacting GC of some kind to avoid fragmentation, or even having a real time GC option.

Go has chosen a very old-fashioned GC design with very few tuning parameters possible, but even so it only exposes a very basic form of control.

Re:More powerful Go execution traces by cwbriscoe on Friday March 15, 2024 @07:29PM (#39721765)
I would rather just write code and trust the existing GC than mess around with knobs all day. I suppose there are < 1% of projects that may see some benefit in messing with the GC.
Re:More powerful Go execution traces by kbolino on Saturday March 16, 2024 @11:34AM (#39726799)
I agree with most of your points but how is it "old-fashioned"? To me, that means things like reference counting or long stop-the-world pauses, neither of which are true of Go.
Re:More powerful Go execution traces by Ironlink on Friday March 15, 2024 @02:03AM (#39712483)
> You can't just run Java code. The JVM has a lot of tricks you have to customize for based on your workload.

This sounds like something you would hear 10 years ago in relation to the CMS garbage collector. Since Java 9, G1 has been the default gc for multi core workloads and is self-tuning. The CMS gc was removed 4 years ago. If you do need to tune G1, the primary knob is target pause time. While other knobs exist, you should think carefully before using them.

We run all of our workloads with vanilla settings.

Re:More powerful Go execution traces by tsimionescu on Friday March 15, 2024 @01:52AM (#39712438)
I think Go is catching up, but it's still significantly behind. For example, Go memory profiles are much, much worse than Java's - they don't even have them integrated with the GC to show the ownership graph (they can only show where each object was allocated, instead of which other objects are holding a reference to it). The CPU profiling parts seemed more up to par. This tracing thing is nice, I'm not as familiar with this are of Java. Also, I don't think Java has a built-in race detector (except perhaps for the detection of concurrent write and iterations in collections?).

Also, the OpenJDK JVM supports live debugging and code hotswap, going so far as to de-optimize code you're debugging on the fly to make it readable. Go doesn't support live code reload even in local builds.

Re:More powerful Go execution traces by tptacek on Friday March 15, 2024 @10:36AM (#39716243)
I really like Go's tooling, and while I'm fluent in Java I've never been on a full-time Java team. I've remarked to Java friends in the past that I think Go has best-in-class tooling and had my ass handed to me, in detail and at length. By many accounts, Java is the gold standard for tooling in language ecosystems. It's a compliment to Go that you'd even consider the comparison. :)
Re:More powerful Go execution traces by lycopodiopsida on Friday March 15, 2024 @10:40AM (#39716283)
Java's tooling is indeed very good but comes with a huge downside of being bound to an IDE.
Re:More powerful Go execution traces by atombender on Friday March 15, 2024 @03:58PM (#39720025)
One of the weakest areas is analyzing heap dumps.

The current format has very limited tooling; "go tool" has some extremely rudimentary visualization. There is gotraceui [1], which is much better, though you need to use Go trace regions to get much useful context.

There's a proposal to support Perfetto [2], but I don't know if anything has come of it.

[1] https://gotraceui.dev/

[2] https://perfetto.dev/