7 ms·
I think apart from streams it was Kotlin that did the trick.
by isbvhodnvemrwvn 5y ago
I think apart from streams it was Kotlin that did the trick.
- pulse7 5y agoIt doesn't matter "who did the trick". It is well known that Java was influenced by ideas in other programming languages from the beginning. And also other languages - including Scala and Kotlin - are similar in this respect... So yes: Kotlin influenced Java and Java influenced Kotlin. Let's compare final products with final products and not "how did we get there"...
- pjmlp 5y agoBoth are guest languages, Java owns the platform. What did the trick are the other programming languages that can stand on their own as platforms.
- deleted 5y ago[deleted]
- asdasdasdch 5y agoScala can compile to JS or LLVM. Why owning a platform when amazing ones already exist?
- pjmlp 5y agoOne either gets to say where the platform goes, or keeps playing catch-up with its features, requires additional tooling, wrapper libraries, care about FFI, IDE plugins that understand all of that in a coherent way.
- hocuspocus 5y agoHow so? Kotlin doesn't even have proper pattern matching.
- high_density 5y agonewb here -- please expand more on this. Are there stuff that kotlin's pattern-matching can't do?
- valenterry 5y agoYou can find some discussion and good examples here: https://discuss.kotlinlang.org/t/destructuring-in-when/2391/7 https://discuss.kotlinlang.org/t/destructuring-in-when/2391/...
- MrPowers 5y agoHere's a quote from Reynolds, one of the creators of Spark: > The primary issue I can think of comes from the lack of pattern matching. Kotlin’s language designer left out pattern matching intentionally because it is a complex feature whose use case is primarily for building compilers. However, modern Spark (post Catalyst / Tungsten) look a lot like compilers and as a result the internals would become more verbose if built using a language that doesn't support pattern matching. Source: https://www.quora.com/profile/Reynold-Xin https://www.quora.com/profile/Reynold-Xin
- serial_dev 5y agoWhat they probably meant is that both Scala's and Kotlin's improvements pushed Java to improve. Both languages had many different features that back then weren't available in Java but since then got added to the Java language, and that made Java better, too.
- hocuspocus 5y agoI still don't see how Kotlin is involved. People drafting JEPs are well aware of how modern languages, including the ones running on the JVM, have evolved in the past decades. Kotlin is pretty late to the party and hasn't really brought anything new to the JVM (by choice), except for coroutines maybe. Edit: see pron's comment below.
- 5y ago
- valenterry 5y agoScala was probably the major factor here. However, the fact that Kotlin picked up these features from Scala (or at least inspired it) also proves that they are mature/stable and this has always been important for Java - so Kotlin did have an impact as well.
- pron 5y agoJava has not picked up a single feature from Kotlin yet (maybe nullability types someday?), and, in fact, opted for very different ones (e.g. contrast records vs. data classes, virtual threads vs. syntactic couroutines), although I guess Scala has provided some inspiration for some features, as Java's are closer to Scala's than to Kotlin's. ML is probably the biggest influence, with some Haskell flavour. But I find it amusing that people think that Java is trying to compete with other languages on the Java platform, no matter how small, rather than with bigger, more relevant competitors.
- bberrry 5y agoText blocks?
- pron 5y agoHmm, I think Kotlin's are similar to Python's, but Java's are different (whitespace handling).
- _old_dude_ 5y ago> ML is probably the biggest influence I disagree. Java records are from Standard ML but sealed is not, it's from Scala with the improvement that subtypes of a sealed types are sealed too. Java still not have a real syntax for ADT, Standard ML has datatype, Rust or Scala 3 have enums on steroid [1]. [1] https://dotty.epfl.ch/docs/reference/enums/adts.html https://dotty.epfl.ch/docs/reference/enums/adts.html
- pron 5y agoJava records and sealed types are its interpretation of product and sum types, and, true, this interpretation draws inspiration from Scala's. Deconstructing patterns are coming soon, but Java now does have real syntax for ADTs: sealed interface Expr {} record ConstantExpr(int i) implements Expr {} record PlusExpr(Expr a, Expr b) implements Expr {} record TimesExpr(Expr a, Expr b) implements Expr {} record NegExpr(Expr e) implements Expr {} For non-record classes, deconstructing patterns will be something like a dual to methods, and almost a first-class citizen. Among other things, they will allow patterns to support API designs that predate records and sealed types.
- xfer 5y agoKotlin doesn't sound like a good language to bet on since most suitable(for jvm) features it has will be integrated by Java now that it has picked up pace. I guess it only has decent marketshare because of google's android support(they are throwing stuff on the wall to move away from Oracle IP i guess) and Jetbrains being very popular among java devs.
- pjmlp 5y agoThat story regarding Kotlin and Oracle doesn't sell because unless Google rewrites Android toolchains in Kotlin/Native, there is plenty of JVM infrastructure to deal with, and so far there haven't been signs to fully replace Android Java. The sour grapes of the Kotlin/Android marriage is that going forward one will need KMM for code between JVM and ART, or be happy to just use what ART undestands.
- RhodesianHunter 5y agoMost F500's with large Java codebases including Google and Amazon are already betting big on Kotlin for server side development.
- halfmatthalfcat 5y agoSource? Never seen or heard a major F500 pick up Kotlin as their primary backend lang over Java.
- loganhood 5y agoI'm an SDE at AWS. Many teams including mine are using Kotlin for backend dev.
- darksaints 5y agoI don't know about betting on it, but the type before identifier syntax has always been a pet peeve of mine, and so I'd never willingly use java if I have a choice. And null handling. Fuck Java's ridiculously verbose and error prone null handling.
- 5y ago
- namelosw 5y agoIt could also be transitive: Scala inspired Kotlin and then Kotlin did the trick, I hope they could share the credit :)
- halfmatthalfcat 5y agoI was waiting for this comment. Every single thread about Scala has someone pushing this narrative that Kotlin is the real arbiter of change when it really has been Scala the entire time pushing boundaries on the JVM. Kotlin is great and if you want a cleaner Java experience, by all means use it but Scala is real champion in pushing many, many things into the mainstream.