top | item 43673319

(no title)

hesdeadjim | 10 months ago

Go user for ten years and I don’t know what happened, but this year I hit some internal threshold with the garbage type system, tedious data structures, and incessant error checking being 38% of the LoC. I’m hesitant to even admit what language I’m considering a full pivot to.

discuss

order

likeabbas|10 months ago

Java 21 is pretty damn nice, 25 will be even nicer.

For your own application code, you don't have to use exceptions you can write custom Result objects and force callers to pattern match on the types (and you can always wrap library/std exceptions in that result type).

Structured Concurrency looks like a banger of a feature - it's what CompletableFuture should've been.

VirtualThreads still needs a few more years for most production cases imo, but once it's there, I truly don't see a point to choose Go over Java for backend web services.

fpoling|10 months ago

And Java has non-trivial advantage over Go of being arch-independent. So one can just run and debug on Mac Arm the same deployment artifact that runs on x86 server.

Plus these days Java GC has addressed most of the problems that plagued Java on backend for years. The memory usage is still higher than with Go simply because more dynamic allocations happens due to the nature of the language, but GC pauses are no longer a significant problem. And if they do, switching to Go would not help. One needs non-GC language then.

t-writescode|10 months ago

And if you want even cleaner and simpler syntax, while getting the benefits of the JVM, then Kotlin is a nice "step up" from there!

j-krieger|10 months ago

I like the idea behind Go, but I feel physical pain everytime I have some sort of `go mod` behaviour that is not immediately obvious. Import/Export is so easy, I still don't get how you can fuck it up.

pdimitar|10 months ago

I found Golang to be a gateway drug to Rust for me.

If you want strong control and very unforgiving type system with even more unforgiving memory lifetime management so you know your program can get even faster than corresponding C/C++ programs, then Rust is a no-brainer.

But I did not pick it for the speed, though that's a very welcome bonus. I picked it for the strong static typing system mostly. And I like having the choice to super-optimize my program in terms of memory and speed when I need to.

Modelling your data transformations with enums (sum types) and Result/Option was eye-opening and improved my programming skills in all other languages I am using.

throwaway2037|10 months ago

    > you know your program can get even faster than corresponding C/C++ programs
I have seen this argument a few times here are HN. To be clear, I interpret your phrase that Rust "will eventually" be faster than C or C++. (If I read wrong, please correct.) However, I have never seen any compelling evidence that demonstrates equivalent Rust code is faster than C or C++ code. Some lightly Googling tells me that their speeds are roughly equivalent (within 1-2%).

myaccountonhn|10 months ago

OCaml is underrated IMO. It's a systems language like Go with a simple runtime but functional with a great type system and probably best error handling out of any language I've used (polymorphic variants).

pdimitar|10 months ago

Call me when they figure they should include UTF-8 strings by default. And stop having several low-level string libraries flying around.

OCaml needs more coherence and unity. It offers too much choice.

treyd|10 months ago

OCaml and Go are not considered systems programming languages, in part due to having required heavy runtimes and garbage collection.

chuckadams|10 months ago

Raku? Unison? Qi? Don't tell me it's something boring like C# ;)

hesdeadjim|10 months ago

Caught me, C#. Library quality has improved a lot in ten years, the language feels modern, and one of Go's biggest advantages, single binary cross-compile, is way less relevant now that dotnet standard installs easily on every OS I care about. I was prototyping some code that needed to talk to OpenAI, Slack, and Linear and the result was.. fast and extremely readable inline async code. I've interacted with these APIs in Go as well and by comparison, ultra clunky.

We're a video game studio as well using C#, and while game programmer != backend programmer, I can at least delegate small fixes and enhancements out to the team more easily.