11 ms·
Under the Hood with Java 10 Enhanced Generics
- lmm 12y agoIf 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.
- rational-future 12y agoYeah, 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.
- jordanpg 12y agoMS 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.
- eropple 12y agoI 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.
- lukedegruchy 12y agoI 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.
- eropple 12y agoMeh? 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.)
- lukedegruchy 12y agoWhat's wrong with Ceylon's type system? I find it incredibly well designed. For instance, the Ceylon compiler won't allow you to assign null to a non-optional variable. Also, there is a bottom type, which makes controvariance far more manageable. I could go on.
- jbooth 12y ago"Talking it out" isn't an option when you're dealing with code that's older than last week, let alone code written by developers that you've never met - you can't talk it out retroactively. That's a huge part of the 'which effective subset' argument against C++ and Scala. The argument is that, in the long term, 'simplicity and consistency', even if clunky at times, are way more effective than 'expressiveness'.
- 12y ago
- lukedegruchy 12y agoScala 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.
- pkinsky 12y agoScala supports value types now: http://docs.scala-lang.org/overviews/core/value-classes.html http://docs.scala-lang.org/overviews/core/value-classes.html
- hyperpape 12y agoThe document says that you can't actually always avoid the Object allocations, because of the JVM. I'm pretty sure you'll need VM changes in addition to language changes for this.
- eropple 12y agoThis 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!
- caoilte 12y agoThere are a lot of problems with reification. It's a real strait-jacket. It would kill the JVM as a platform for Clojure and Ruby and kill some of the advanced parts of Scala.
- sanderjd 12y agoInteresting! Could you expand on that or direct me to some good links on the subject?
- papauschek 12y agoI talked with Vlad Ureche (from the EPFL Scala Team) about this very topic a few months ago after Scala Days Berlin. He said that some Scala features would not be possible to implement on the CLR because of its restrictive generics implementation. So while JVMs generics type erasure is a pain, it seems to give more room for innovation on the language level. Unfortunately I did not understand the specific reasons he gave, but it had to do something with reification.
- deleted 12y ago[deleted]