Live data from Hacker News

Under the Hood with Java 10 Enhanced Generics

infoq.com

1–10 of 45 posts

Re: Under the Hood with Java 10 Enhanced Generics

#2
If you can't wait until 2018, it's worth pointing out that Scala has production-quality implementations of these features on the JVM already, usable today. There are plenty of nontrivial limitations (that will cause a traditional boxed codepath instead), but the core features are working.

Re: Under the Hood with Java 10 Enhanced Generics

#3
post #2

If you can't wait until 2018, it's worth pointing out that Scala has production-quality implementations of these features on the JVM already, usable today. There are plenty of nontrivial limitations (that will cause a traditional boxed codepath instead), but the core features are working.

Yeah, but then it has also around 10K other features, most of which you don't need. Most Java developers won't be able to become Scala masters by 2018 anyway, if at all.

On the other hand C# has even better generics than this proposal, along with await, dynamic, yield. And it's now supported by MS and Xamarin on all big platforms.

Re: Under the Hood with Java 10 Enhanced Generics

#4
This is really troubling to me. I'm a Scala developer and JVM nerd by trade (though more devops and high-level architecture as of late) and I've been hoping really hard that they'd just bite the bullet, flag-day the current type erasure and non-unified type system, and make Java 10 what...well, what the CLR is, now, today. The generic specialization route they describe is at best gross, isn't much better than what Scala already does today, and kicks the real problems only slightly further down the road.

Still being crap in 2017, when the alternatives are good to great now, is dangerous, and Oracle's fear of alienating the masses of people who'll forever be two versions of Java behind is leaving the door open for Microsoft. I write games in C# in my free time, and between how great VS/R# is[1] and Microsoft supporting a CLR implementation I am inclined to trust more than Mono's on Linux and OS X, I'm excited at the prospect of being able to use .NET for server applications (no, no Windows Server for me, not now and not never) in the future.

[1] - IntelliJ comes close, but it does suffer, from a usability standpoint, from being cross-platform and having to compromise--I'd rather run a VM on my Mac to use VS than use IntelliJ, all things considered!

Re: Under the Hood with Java 10 Enhanced Generics

#5
post #2

If you can't wait until 2018, it's worth pointing out that Scala has production-quality implementations of these features on the JVM already, usable today. There are plenty of nontrivial limitations (that will cause a traditional boxed codepath instead), but the core features are working.

Scala isn't the only alternative JVM language that has a superior generics implementation and that doesn't have primitives.

What neither Scala nor those languages have is support for value types (structs) at the JVM level. Generics over primitives and value types is a natural consequence of the introduction of value types to the JVM.

Re: Under the Hood with Java 10 Enhanced Generics

#6
post #2

If you can't wait until 2018, it's worth pointing out that Scala has production-quality implementations of these features on the JVM already, usable today. There are plenty of nontrivial limitations (that will cause a traditional boxed codepath instead), but the core features are working.

Yeah, but then it has also around 10K other features, most of which you don't need. Most Java developers won't be able to become Scala masters by 2018 anyway, if at all. On the other hand C# has even better generics than this proposal, along with await, dynamic, yield. And it's now supported by MS and Xamarin on all big platforms.

MS has announced that .NET will be supported by "all big platforms". We all anxiously await the download page that contains an MS-branded OS X CLR.

Re: Under the Hood with Java 10 Enhanced Generics

#7
post #2

If you can't wait until 2018, it's worth pointing out that Scala has production-quality implementations of these features on the JVM already, usable today. There are plenty of nontrivial limitations (that will cause a traditional boxed codepath instead), but the core features are working.

Yeah, but then it has also around 10K other features, most of which you don't need. Most Java developers won't be able to become Scala masters by 2018 anyway, if at all. On the other hand C# has even better generics than this proposal, along with await, dynamic, yield. And it's now supported by MS and Xamarin on all big platforms.

I like C#, I write a lot of it, but the claims of complexity regarding Scala are just so vastly overblown. Anyone who's a competent Java programmer and has an open mind (which is the nicest way I can think of to say "doesn't pee themselves when they see a lambda") can be a competent Scala programmer within a month of daily use. It's not that hard, the tooling today in IDEA is roughly Java-level in terms of quality, and the language itself steers you towards constructs that make doing the Right Thing fairly easy.

Re: Under the Hood with Java 10 Enhanced Generics

#8
post #7

Earlier quoted context omitted.

Yeah, but then it has also around 10K other features, most of which you don't need. Most Java developers won't be able to become Scala masters by 2018 anyway, if at all. On the other hand C# has even better generics than this proposal, along with await, dynamic, yield. And it's now supported by MS and Xamarin on all big platforms.

I like C#, I write a lot of it, but the claims of complexity regarding Scala are just so vastly overblown. Anyone who's a competent Java programmer and has an open mind (which is the nicest way I can think of to say "doesn't pee themselves when they see a lambda") can be a competent Scala programmer within a month of daily use. It's not that hard, the tooling today in IDEA is roughly Java-level in terms of quality, a…

I disagree. I think Scala suffers from Perlisms like being too succinct and more than one way of doing things (ex omitting dots and parens to invoke a method). There are newer alternative JVM languages that are more consistent and preferable to Java, so I disagree with your argument that those of us that prefer not to use Scala are Luddites.

Re: Under the Hood with Java 10 Enhanced Generics

#9
post #7

Earlier quoted context omitted.

I like C#, I write a lot of it, but the claims of complexity regarding Scala are just so vastly overblown. Anyone who's a competent Java programmer and has an open mind (which is the nicest way I can think of to say "doesn't pee themselves when they see a lambda") can be a competent Scala programmer within a month of daily use. It's not that hard, the tooling today in IDEA is roughly Java-level in terms of quality, a…

I disagree. I think Scala suffers from Perlisms like being too succinct and more than one way of doing things (ex omitting dots and parens to invoke a method). There are newer alternative JVM languages that are more consistent and preferable to Java, so I disagree with your argument that those of us that prefer not to use Scala are Luddites.

Meh? B&D languages bother me, for the most part--your criticisms would apply to C++, which I'm also happy to use. I mean, omitting dots and parens is primarily of value in flexible DSLs. Otherwise? Talk like adults and figure out the idioms you wish you adopt. Does one of your developers do something that you don't like. Then y'all talk it out. Not hard.

Consistency is important, but effectiveness is, by my lights, moreso. Java's biggest problem isn't the language, which is sad, but its type system, and I've yet to see a newer alternative JVM language with a type system remotely worth discussing. (Which isn't to say it doesn't exist, but it sure isn't Ceylon or Kotlin.)

Re: Under the Hood with Java 10 Enhanced Generics

#10
post #7

Earlier quoted context omitted.

I like C#, I write a lot of it, but the claims of complexity regarding Scala are just so vastly overblown. Anyone who's a competent Java programmer and has an open mind (which is the nicest way I can think of to say "doesn't pee themselves when they see a lambda") can be a competent Scala programmer within a month of daily use. It's not that hard, the tooling today in IDEA is roughly Java-level in terms of quality, a…

I disagree. I think Scala suffers from Perlisms like being too succinct and more than one way of doing things (ex omitting dots and parens to invoke a method). There are newer alternative JVM languages that are more consistent and preferable to Java, so I disagree with your argument that those of us that prefer not to use Scala are Luddites.

Omitting dots and parens is superficial; it's no more a Perlism than allowing whitespace or extra parens (which almost all languages do).

Could you give an example of what you consider a more consistent JVM language? I find Scala is often more consistent, because it uses a small number of powerful features. E.g. Kotlin doesn't have Scala's implicits - so it instead has a bunch of different special-case features (e.g. extension methods) to replicate their use cases.

Post reply on HN