←back to thread

153 points michaelanckaert | 3 comments | | HN request time: 0s | source
Show context
xvilka ◴[] No.23485548[source]
Does this mean that SourceHut will become completely written in Go? Amazing news if so!
replies(1): >>23485670 #
CameronNemo ◴[] No.23485670[source]
Why? I am currently converting a Flask/SQLAlchemy application to Go and gRPC. Go has not been that much of a win from my perspective. Lots of rough edges and missing functionality in libraries available, a lackluster type system that does enough to get in the way but not enough to properly express programmatic intention, and an atypical non-ideal error handling model have left me with little reason to champion Go. Not that it is a terrible language, I just do not see the value add compared to even Python (let alone Kotlin or Rust).
replies(3): >>23485708 #>>23486612 #>>23487224 #
philosopher1234 ◴[] No.23485708[source]
Could you name some specific rough edges and missing functionality that have frustrated you? I'm a big fan of Go and have a good experience with it, so I'd be very curious to hear from someone with an opposite experience.
replies(1): >>23485774 #
CameronNemo ◴[] No.23485774[source]
On several occasions I have gotten panics (segfaults), many times without using CGo. This is not something I would expect from a "high level" language that has a garbage collector.

The constant use of generated code is another real pain point, particularly when I am writing business logic that needs to operate on generated types for which there is no interface available that does what I need (and why would there be? how would the library/codegen-tool author know all the permutations of business logic that might be out there?).

The sql library has some fairly annoying documentation, e.g.

> Scan implements the Scanner interface.

https://golang.org/pkg/database/sql/#NullBool.Scan

> Scanner is an interface used by Scan.

https://golang.org/pkg/database/sql/#Scanner

There is only really one concrete example of how to use Scan on the godoc page.

The introspection capabilities (reflect package) are quite obtuse and error prone (basically requiring 100% test coverage because you lose nearly the entire type system), yet absolutely critical to implementing anything notably complex with Go.

replies(2): >>23485807 #>>23485882 #
1. tptacek ◴[] No.23485882[source]
Null pointer exceptions in Go are, technically, SEGVs. But they're just NPEs. Do you have something more interesting than that?
replies(1): >>23486087 #
2. searchableguy ◴[] No.23486087[source]
Have you read this - https://blog.twitch.tv/en/2019/04/10/go-memory-ballast-how-i...
replies(1): >>23489874 #
3. tptacek ◴[] No.23489874[source]
Yes.