Most active commenters
  • pjmlp(4)
  • lenkite(4)
  • demi56(3)

←back to thread

257 points pmig | 31 comments | | HN request time: 0.465s | source | bottom
1. pjmlp ◴[] No.43099587[source]
This looks like one of the typical "we switched from A to B, whithout actually mastering A, so B is alright" kind of posts.

Just on the monitoring part, Go has nothing even close to VisualVM, Flight Recorder, JRebel, VM agents, JMX.

No mention of AOT compilers, JIT caches, and so forth.

replies(9): >>43099839 #>>43099850 #>>43100755 #>>43100882 #>>43101164 #>>43101267 #>>43101355 #>>43102589 #>>43102655 #
2. linkdd ◴[] No.43099839[source]
And it's fine. Why continue using something you don't master?

Yes you could try to master it, but it takes years. If another tool compensates your lack of mastery, why not use it?

replies(3): >>43100385 #>>43100805 #>>43101661 #
3. ◴[] No.43099850[source]
4. WJW ◴[] No.43100385[source]
To me the implication is that the culture at this company won't allow this team to master Go either, and in a few years there will be a post describing how they moved from Go to another language.

Many people like to write about how Golang is so simple, but the drawback of that simplicity is that many features of other languages are either covered by additional dependencies or by inflating code size. It's just as possible for Go projects to devolve into big balls of mud as for any other language.

replies(2): >>43102026 #>>43102257 #
5. zipy124 ◴[] No.43100755[source]
I like to think of these problems as having skill ceilings and skill floors like in video games. For large companies often the skill floor is more important than the skill ceiling. If it is easier to start in B than A, even though after years of experience A can be much better, it might still be a better choice to use B.

When you have lots of junior devs, you are more concerned with this upstart time, and I think in this case for example, Java makes it very easy to write poor code, or use poor packages. Yes a master in Java can take advantage of the extremely mature ecosystem with tools like those you have mentioned, but for those who are not experienced like you, they may get better productivity out of what you see as the less powerfull tool.

replies(1): >>43102131 #
6. nprateem ◴[] No.43100805[source]
Because like any shortsighted decision it can come back to bite you later.
7. kitd ◴[] No.43100882[source]
pprof data via HTTP is part of the Go stdlib and is pretty close, good enough for 95% of cases. One could argue you need those tools less in a Go codebase anyway ;)

AOT is mentioned and JIT is not relevant.

replies(1): >>43102028 #
8. unscaled ◴[] No.43101164[source]
I think most of the tools on the second line are not highly applicable to a Kubernetes operator, or otherwise would just use the "Cloud Native way of doing things".

Something like JRebel would generally be a big no-no for Kubernetes, where the container image of the operator is expected be immutable (at least in terms of the code running in there). It may or may not be okay for developing an operator, but that's certainly venturing into a bit of an unknown territory.

VM agents and JMX are usually replaced by explicitly adding Open Telemetry support and/or a Prometheus endpoint. It's certainly more boilerplate and manual work, but so many more things are explicit in Go, that's just something you've got to buy into. If you're using Rust or Typescript this could be a lot more automated but that's not the case for Go.

Advanced profiling is probably something you'd have to give up, but I doubt a Spring shop would be deeply into profiling. The low hanging fruit is to just throw away spring and get an immediate 200%-400% performance boost.

But the JVM is still a more mature platform. Throughput is better on the JVM than on Go and some things are very troublesome in Go (basically anything that requires code generation).

My personal "cool tool" that I can run on the JVM but doesn't have a mature equivalent in Go is PIT[1] for mutation testing. But not everybody will be using mutation testing, just like not everybody will be using JRebel or JMX. And it doesn't mean everybody should. If you're a Spring a shop the thing you'll be probably missing most in Go would be things like Dependency Injection, Java-like ORMs, reflection magic and Spring Configuration Server.

[1] https://github.com/hcoles/pitest

9. xxs ◴[] No.43101267[source]
Pretty much. There are lots of post in that form, it makes for a good self tapping on the back and few blog posts - without any questions answered.

OTOH - if that's what makes run the business, I'd not argue.

10. llm_nerd ◴[] No.43101355[source]
Totally orthogonal, but it's also a super weird piece in that it starts by listing three authors, but then has several paragraphs giving a personal account of a single person's history, as if someone wrote their blog entry and then other people demanded a slice of the credit.
11. lenkite ◴[] No.43101661[source]
There are a lot of leanings to master for Go as well which they may have not discovered.

As an example, the Go runtime does not honor container resource limits. You would think this would be one of the very first fundamental features supported out of the box by an advertised "cloud native" language.

replies(1): >>43101771 #
12. demi56 ◴[] No.43101771{3}[source]
> As an example, the Go runtime does not honor container resource limits

That’s no longer true for Go 1.19+

replies(1): >>43101804 #
13. lenkite ◴[] No.43101804{4}[source]
AFAIK, the basic issue is still open at https://github.com/golang/go/issues/33803 and https://github.com/golang/go/issues/59715.

You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

Go 1.19 only had this in its notes for memory changes

"...includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program"

Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...

replies(2): >>43101997 #>>43102206 #
14. btreecat ◴[] No.43101997{5}[source]
Most Jvm shops/devs I know are still on 11
replies(3): >>43102033 #>>43102207 #>>43107417 #
15. btreecat ◴[] No.43102026{3}[source]
This is why I don't buy the FP hype
16. pjmlp ◴[] No.43102028[source]
pprof isn't not even close to what Visual VM and Flight Recorder are capable of, hence why then there are stuff like open telemetry integration, which require active coding to provide sensible data.

This is the only mention of AOT

> Java's JIT (Just-In-Time) compiler and Go's AOT (Ahead-Of-Time) compiler are definitely two very different approaches and therefore hard to compare.

Zero content on all the options since Excelsior JET and other commercial alternatives came to be, or the free beer alternatives available nowadays.

JIT caches and plain old JIT aren't the same.

JIT caches are similar in concept to AOT with PGO, with the difference that instead of doing that once for the lifetime of the executable with data from test runs, it gets updated after each production execution.

17. lenkite ◴[] No.43102033{6}[source]
That's the problem isn't it ? The Java of 8+ years ago is always compared to the Rust/Go/Python of today. (I am also guilty of this)
18. ivan_gammel ◴[] No.43102131[source]
I do have experience of managing junior teams and I think Java is actually great for them. You only need one senior person to kick off the project and put down the rails - a relatively small effort if you use frameworks instead of bespoke solutions. The team just needs to follow the lead. It is extremely cost efficient and good enough for business in terms of quality/security/performance.
replies(1): >>43104081 #
19. demi56 ◴[] No.43102206{5}[source]
> ...includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program"

Of course it’s a runtime setting, it won’t affect other factors but you can’t say it didn’t solved anything “because there’s a GitHub issue open” Then Go runtime was unpredictable because of its ideology “CPU is unlimited but not Memory” and containers are kinda of a dynamic resource allocated but it did solve vast amount of problem dealing with kernel OOM and unpredictable GC cycles

> You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

I would be surprised if the Go team implemented it into the runtime, because some devs would love to have there own way of handling such settings so I don’t see it as an issue

> Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...

We can’t just compare added features if don’t compare how backwards compatible the language is at that time I don’t know much about Java, but I wouldn’t say the same from upgrading from Go 1.9 to Go 1.19

replies(1): >>43102832 #
20. gf000 ◴[] No.43102207{6}[source]
Upgrading from 11 is trivial though and we are at almost 24. The hardest was 8->9, or 9->11.
21. ReflectedImage ◴[] No.43102257{3}[source]
Golang's standard library looks pretty complete to me and they will probably master it in a month.
replies(2): >>43103002 #>>43103556 #
22. IshKebab ◴[] No.43102589[source]
I mean, they don't mention monitoring... so so why would they need to master it? How would mastering monitoring tools help them with the problem that Java startup time is orders of magnitude slower than with Go? Especially without having to do any extra configuration work.
23. Ygg2 ◴[] No.43102655[source]
I'm not sure who said it, but the quote went something like this: Programmers are at fault for the current status in Computer Science, rather than working on expanding their knowledge they keep chasing the latest fad.

If someone knows which cankerous Computer Scientist said this, I'd appreciate a reply.

24. lenkite ◴[] No.43102832{6}[source]
Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer. This is a demonstrative example of a fundamental responsibility that should always be delegated to the runtime as the default behavior.

Neither Go 1.19 nor any subsequent version has "solved" this issue.

replies(1): >>43104014 #
25. WJW ◴[] No.43103002{4}[source]
The mindset that you can master any programming language in a month is exactly what I meant in my previous post. There's a veritable cottage industry of "golang pitfalls" blog posts out there that show there are absolutely a lot of footguns in Go.

For example, what do you think the following should print?

    values := []int{4, 8, 15, 16, 23, 42}
    for value := range values {
     fmt.Println(value)
    }
I don't think there are very many people who would guess the integers 0 to 5.

I also like the following one:

    ch := make(chan int)
    ch <- 1
    fmt.Println(<-ch)
What would this print? The only correct answer is sadly "fatal error: all goroutines are asleep - deadlock!".

Golang is a fine language and simpler than most, but sadly "simpler" is not the same as "simple".

26. mike_hearn ◴[] No.43103556{4}[source]
But people here are comparing a language standard library with a framework like Spring, which doesn't make sense.

The Java standard library has a web server in it, it has JDBC. You could use those directly. That's comparable to the Go standard library. For real apps people don't do this because they want a lot more, like simplified database access or session management.

Look at this: https://pkg.go.dev/database/sql

It strongly resembles JDBC. Doing a database query with that is verbose and error prone. Compare the work needed to do a lookup query and map the results to a data structure with that to (Micronaut syntax, Spring is similar):

    @JdbcRepository(dialect = Dialect.POSTGRES) 
    interface GophersRepository extends CrudRepository<Gopher, String> {}
... and later ...

    var someGopher = gophersRepository.findById("goo");
Add the username/password/host/port to the config file and that's all you need for db access. Compare to the Go stdlib which wants you to manage drivers, connections, prepared statements, rollbacks, etc. It's a different level of abstraction.
replies(1): >>43107388 #
27. demi56 ◴[] No.43104014{7}[source]
> Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer.

Because there’s no one way solution to this problem, the problem isn’t unique to only Go, but every GC language because you’re starving the program if there isn’t sufficient CPU Quota it will all eventually lead to CPU throttling, this isn’t really the problem of Go or any other GC language but at the OS layer, the inherent nature of containers

Secondly am pretty sure the Linux CFS does not strictly follow the CPU Quota, tho there could be something like a panic or warning, or switching to entirely different memory management just for what ? people who want 10ms ?

28. zipy124 ◴[] No.43104081{3}[source]
Another re-phrasing of my comment is that perhaps using Go they do not require the strong senior to kick it off.

Otherwise yes there is always the argument of "they're just using it wrong" etc...

ultimately: ¯\_(ツ)_/¯

replies(1): >>43107420 #
29. pjmlp ◴[] No.43107388{5}[source]
And it misses something like Swing, which while not perfect, does the job and the best Go can hope for is Fyne, as third party.

Multithreaded collection types.

Configuring scheduling algorithms.

Pluggable services, cryptography algorithms, filesystem.

Sane way to manage dates, granted the original one was a bit clunky, but way better than parsing strings.

Sometimes I wonder if folks that criticise Java, and .NET, actually spend any time learning their standard libraries in practice.

30. pjmlp ◴[] No.43107417{6}[source]
And many folks still code in C89, C99, C++98, Python 2, .NET Framework....

Language is not to blame for unwillingness to move forward.

31. ivan_gammel ◴[] No.43107420{4}[source]
No. Go is worse simply due to lack of established design patterns. Spring (just like Angular) forces to build things in a certain way and has a lot of reasonable defaults. E.g. CSRF protection is enabled by default in Spring Security. CORS configuration is trivial. Magic? Yes. In Go juniors won’t even think it is necessary and may not figure out that they need a 3rd party library for that (or build it correctly).