I've used a lot of Java and C#, and a decent amount of Go. I'm not sure I would call Go inferior. The design goals were different. I'm also not a language wonk, so maybe that's why I enjoy the relative simplicity of Go. The developer loop of code, run, code is very fast, and the standard library is good out the box. I just want to write code and get stuff done. To that end, Go is another capable, workman type language (like Java or C#).
Neither have addressed it though - they do have works in progress. Same as the lack of decent threading in Java.
It's been a WIP for years. Lets judge based on status quo rather than being disingenious.
How does Java not have decent threading? Go doesn't even have actual threads.
I'm assuming you're talking about goroutines aka virtual threads/fibers whatever which are entirely different from actual threads.
apologies, but yes, you're correct - I was referring to green threads
Hopefully will preview in next release (6 months release cycle)
http://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.h...
EAP build - http://jdk.java.net/loom/
I'm not aware of any current Java project on Sum types. There is multi-catch for exceptions but no immediate plans I know to use elsewhere.
A form of pattern matching and switch expression has already made it to the language as of JDK 14. Those are paving the way for full blown pattern matching and sealed types:
Re:The Next Step for Generics
by richardwhiuk on Tuesday June 16, 2020 @05:29PM
(#23544437)
Java aren't fixing nulls, IMHO. They are making it worse.
How are they making it worse?
In any case, there already exist solutions in place:
Re:The Next Step for Generics
by richardwhiuk on Thursday June 18, 2020 @12:56PM
(#23565053)
The code ends up looking like:
Optional<Integer> foo;
//....
if (foo != null) {
foo.and_then(new Consumer () {
function accept(Integer foo) {
}
});
}I would never assign null to an Optional nor use a library that returned one.
To ensure assignment before use make it final.
Except for green threads.
Re:The Next Step for Generics
by erik_seaberg on Tuesday June 16, 2020 @07:29PM
(#23545626)
That's true though Project Loom is working on fibers. There's already an early access release to test.
Minor point, they've settled on the name "virtual threads" instead at this point.
Re:The Next Step for Generics
by balfirevic on Tuesday June 16, 2020 @06:39PM
(#23545174)
Sum types are not planned for C# 9, are they?
It has pattern matching, but not a full discriminated union implementation yet. That seems to be on the roadmap though:
> lack of proper sum types (C, C++, Java, JS)
Incidentally, Java and C# have addressed (or are in the process of addressing) both issues. Both languages/platforms are superior to golang in almost every conceivable way.