News for hackers. Stuff that matters.
Re:I can't keep up with idiomatic Rust by tmh88j on Wednesday April 08, 2020 @10:23PM (#22819241)
>IMO Go is more like C people took a stab at making a Java.

I haven't used Go beyond tutorials and some very basic programs, but I am pretty comfortable with Java. What about Go makes you feel it's relatable to Java? From what I've read the lack of generics is a hot topic in the Go community, but they're pretty crucial to most programs written in Java. Is this still true?

Re:I can't keep up with idiomatic Rust by correct_horse on Wednesday April 08, 2020 @10:51PM (#22819352)
As a side note, Java also didn't ship with generics. Java was released in the mid 90s and didn't have generics until about 10 years later with version 5. This timing should feel familiar - Go first appeared ~10 years ago in 2009.

You may remember that in Java 1.4, `get`ting from collections (e.g. ArrayList) always returned Object, which you were expected to cast to their runtime type (or a class that their runtime type inherits from). I was young at the time, correct me if I'm wrong. Contrast this with Go's solution, which seems to be user-inaccessible compiler magic. I much prefer Go's solution to Java's, but I also like generics.

Re:I can't keep up with idiomatic Rust by saagarjha on Wednesday April 08, 2020 @10:53PM (#22819361)
I really hate user-inaccessible compiler magic. Java had its fair share of that, but Go seems to take it even further :(
Re:I can't keep up with idiomatic Rust by Skunkleton on Thursday April 09, 2020 @03:44PM (#22826407)
I think compiler magic is pretty great. Hotspot is a pretty magical compiler. Go is less magical IMO because it is AOT compiled.
Re:I can't keep up with idiomatic Rust by saagarjha on Thursday April 09, 2020 @04:14PM (#22826717)
By compiler magic I really mean syntax reserved to the language itself; for example, Java's String having extra operator superpowers or Go's generics that are only available to a chosen set of standard collections.
Re:I can't keep up with idiomatic Rust by antoinealb on Thursday April 09, 2020 @05:19AM (#22820956)
I think you can do the same in Go, using the empty interface (that can represent any type) and then having the user cast it to the correct type. Unfortunately this is not type safe, and type safe generics in go, such as maps is only available to the compiler.
Re:I can't keep up with idiomatic Rust by doliveira on Wednesday April 08, 2020 @10:32PM (#22819279)
Java didn't have generics before version 5, I think. It was a hell of casting back and forth Object, much like Go and interface{} today.
Re:I can't keep up with idiomatic Rust by Skunkleton on Wednesday April 08, 2020 @11:07PM (#22819418)
The language and tooling is designed for development at scale. Lots of pragmatic trade offs were made. Its not flashy at all, and could even be accused of being a bit boring. It is also appropriate for a similar domain.
Re:I can't keep up with idiomatic Rust by takeda on Thursday April 09, 2020 @02:21AM (#22820267)
yep, there Go was labeled as a replacement for C or Python, and while it in no way replaces C and and as for Python it generally only does when the Python wasn't the right choice from the start.

In reality Go can fully take over Java's problem space.

Re:I can't keep up with idiomatic Rust by qqssccfftt on Thursday April 09, 2020 @05:08AM (#22820913)
> In reality Go can fully take over Java's problem space.

Or, when Project Loom releases, Java will be able to fully take over Go's problem space.

Re:I can't keep up with idiomatic Rust by takeda on Thursday April 09, 2020 @03:39PM (#22826364)
Sorry, my previous post sounded like I was picking a favorite, what I meant is that Go and Java pretty much has identical problem space.
Re:I can't keep up with idiomatic Rust by pjmlp on Thursday April 09, 2020 @07:36AM (#22821551)
Not really, unless it provides generics, JEE and Spring like frameworks, supports all embedded CPUs, Oracle/SQL Server/DB2, mainframes, has an OS of its own, a GUI half as good as Swing,....
Re:I can't keep up with idiomatic Rust by kelnos on Thursday April 09, 2020 @07:30PM (#22828336)
Not without generics it can't. I know a lot of people seem to think that generics aren't necessary in Go, but I vehemently disagree with them.
Re:I can't keep up with idiomatic Rust by krakatau1 on Thursday April 09, 2020 @10:00AM (#22822604)
there is no way that's happening, outside of silicon valley practically no one is using Go, there are millions Java developers who are quite content with language...
Re:I can't keep up with idiomatic Rust by 7thaccount on Wednesday April 08, 2020 @10:29PM (#22819262)
Garbage Collector?
Re:I can't keep up with idiomatic Rust by EdwardDiego on Thursday April 09, 2020 @05:17AM (#22820946)
Go's GC is quite different to Java's though - deliberately not as many knobs to twiddle.