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

←back to thread

257 points pmig | 18 comments | | HN request time: 1.56s | source | bottom
Show context
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 #
1. 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 #
2. 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 #
3. nprateem ◴[] No.43100805[source]
Because like any shortsighted decision it can come back to bite you later.
4. 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 #
5. demi56 ◴[] No.43101771[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 #
6. lenkite ◴[] No.43101804{3}[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 #
7. btreecat ◴[] No.43101997{4}[source]
Most Jvm shops/devs I know are still on 11
replies(3): >>43102033 #>>43102207 #>>43107417 #
8. btreecat ◴[] No.43102026[source]
This is why I don't buy the FP hype
9. lenkite ◴[] No.43102033{5}[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)
10. demi56 ◴[] No.43102206{4}[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 #
11. gf000 ◴[] No.43102207{5}[source]
Upgrading from 11 is trivial though and we are at almost 24. The hardest was 8->9, or 9->11.
12. ReflectedImage ◴[] No.43102257[source]
Golang's standard library looks pretty complete to me and they will probably master it in a month.
replies(2): >>43103002 #>>43103556 #
13. lenkite ◴[] No.43102832{5}[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 #
14. WJW ◴[] No.43103002{3}[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".

15. mike_hearn ◴[] No.43103556{3}[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 #
16. demi56 ◴[] No.43104014{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.

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 ?

17. pjmlp ◴[] No.43107388{4}[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.

18. pjmlp ◴[] No.43107417{5}[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.