![Page 1: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/1.jpg)
Copyright © 2014 Russel Winder 1
Java is DeadLong Live Scala, Kotlin, Ceylon,
etc.
Russel Winder
email: [email protected]: [email protected]
twitter: @russel_winderWeb: http://www.russel.org.uk
![Page 2: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/2.jpg)
Copyright © 2014 Russel Winder 2
Java is Dead
![Page 3: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/3.jpg)
Copyright © 2014 Russel Winder 3
Java is Dying
![Page 4: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/4.jpg)
Copyright © 2014 Russel Winder 4
What are the symptoms?
● Java is seriously verbose.
● Java has poor type inference.
● Java has only low-level support for concurrency and parallelism.
● Java generates a dependency hell .“ ”
● Java is a 1990s imperative language that isn't really object-oriented.
● …
![Page 5: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/5.jpg)
Copyright © 2014 Russel Winder 5
Is there a cure?
● Can Java:
● Be less verbose.
● Have better type inferencing.
● Do concurrency and parallelism better. (Doug Lea, Brian Goetz and others have actually been doing this for a while.)
● Have a reasonable module system, cf. Jigsaw vs. OSGi.
● Be a real object-oriented language.
![Page 6: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/6.jpg)
Copyright © 2014 Russel Winder 6
Prognosis: not great
![Page 7: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/7.jpg)
Copyright © 2014 Russel Winder 7
Alternatives?
![Page 8: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/8.jpg)
Copyright © 2014 Russel Winder 8
Create a new language
● Java is a statically typed, compiled language, so create a new statically typed compiled language:
● Scala
● Kotlin
● Ceylon
● Fantom
● ?
![Page 9: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/9.jpg)
Copyright © 2014 Russel Winder 9
Gross oversimplifications…
![Page 10: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/10.jpg)
Copyright © 2014 Russel Winder 10
Scala
● Integrates functional and object-oriented.
● Very declarative style of expression.
● Strong support for data parallelism. Also Akka for actors and such-like.
● Strong static type checking with inferencing and reified generic type parameters.
![Page 11: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/11.jpg)
Copyright © 2014 Russel Winder 11
Kotlin
● Top-level functions.
● Object-oriented, with functional elements
● Strong static type checking with inferencing.
● Has modules.
● Allows extension methods.
● Compiles to JavaScript or JVM to support end-to-end Web applications development.
![Page 12: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/12.jpg)
Copyright © 2014 Russel Winder 12
Ceylon
● Top-level functions.
● Object oriented with functional features.
● Strong static typing with inference.
● Explicit module system.
● JavaScript and JVM backends so as to be end-to-end for Web applications development.
![Page 13: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/13.jpg)
Copyright © 2014 Russel Winder 13
Fantom
● Top-level functions.
● Object-oriented.
● Integrated modules system via pods.
● Targets JVM and CLR.
![Page 14: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/14.jpg)
Copyright © 2014 Russel Winder 14
?
The identity of this statically typed, object-oriented (with functional bits) language for the JVM will remain unnamed at this time to preserve the air of mystery and suspense.
![Page 15: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/15.jpg)
Copyright © 2014 Russel Winder 15
![Page 16: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/16.jpg)
Copyright © 2014 Russel Winder 16
Code!
![Page 17: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/17.jpg)
Copyright © 2014 Russel Winder 17
![Page 18: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/18.jpg)
Copyright © 2014 Russel Winder 18
![Page 19: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/19.jpg)
Copyright © 2014 Russel Winder 19
![Page 20: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/20.jpg)
Copyright © 2014 Russel Winder 20
What is the value of ?
Easy, it's known exactly.
It's .
Obviously.
![Page 21: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/21.jpg)
Copyright © 2014 Russel Winder 21
It's simples Александр Орлов 2009
![Page 22: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/22.jpg)
Copyright © 2014 Russel Winder 22
Approximating
● What is it's value represented as a floating point number?
● We can only obtain an approximation.
● A plethora of possible algorithms to choose from, a popular one is to employ the following integral equation.
4=∫0
1 1
1x2dx
![Page 23: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/23.jpg)
Copyright © 2014 Russel Winder 23
One possible algorithm
● Use quadrature to estimate the value of the integral which is the area under the curve.–
=4n∑i=1
n 1
1i−0.5n
2
With n = 3 not much to do, but potentially lots of error. Use n = 107 or n = 109?
Embarrassingly parallel.
![Page 24: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/24.jpg)
Copyright © 2014 Russel Winder 24
Because addition is commutative andassociative, expression can be
decomposed into sums of partial sums.
![Page 25: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/25.jpg)
Copyright © 2014 Russel Winder 25
a + b + c + d + e + f
=
( a + b ) + ( c + d ) + ( e + f )
![Page 26: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/26.jpg)
Copyright © 2014 Russel Winder 26
Scatter Gather—
map reduce
data parallel
![Page 27: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/27.jpg)
Copyright © 2014 Russel Winder 27
Code!
![Page 28: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/28.jpg)
Copyright © 2014 Russel Winder 28
ScalaKotlinCeylonFantom
![Page 29: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/29.jpg)
Copyright © 2014 Russel Winder 29
?
![Page 30: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/30.jpg)
Copyright © 2014 Russel Winder 30
Surprise time…
![Page 31: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/31.jpg)
Copyright © 2014 Russel Winder 31
JVM is a Groovy place
![Page 32: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/32.jpg)
Copyright © 2014 Russel Winder 32
Groovy
● Top-level functions
● Object-oriented with functional features.
● Extension methods.
● Compiles to JVM bytes codes or JavaScript (cf. GrooScript)
● A dynamic language with a run time meta-object protocol.
![Page 33: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/33.jpg)
Copyright © 2014 Russel Winder 33
Groovy
A statically typed,compiled language.
![Page 34: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/34.jpg)
Copyright © 2014 Russel Winder 34
@TypeChecked
@CompileStatic
![Page 35: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/35.jpg)
Copyright © 2014 Russel Winder 35
Groovy
● @TypeChecked:
● Traditional dynamic Groovy but with full static (compile-time) type checking.
● @CompileStatic:
● Full static typechecked, compilation to bytecode at compile time.
● No dynamic meta-object protocol.
![Page 36: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/36.jpg)
Copyright © 2014 Russel Winder 36
Code!
![Page 37: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/37.jpg)
Copyright © 2014 Russel Winder 37
![Page 38: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/38.jpg)
Copyright © 2014 Russel Winder 38
Code!
![Page 39: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/39.jpg)
Copyright © 2014 Russel Winder 39
Did I mention invokedynamic?
![Page 40: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/40.jpg)
Copyright © 2014 Russel Winder 40
Code!
![Page 41: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/41.jpg)
Copyright © 2014 Russel Winder 41
Java is Dead!
![Page 42: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/42.jpg)
Copyright © 2014 Russel Winder 42
Groovy(or Scala, Kotlin, Ceylon, Fantom, )…is the future of static languages
on the JVM.
![Page 43: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/43.jpg)
Copyright © 2014 Russel Winder 43
2014-03-18
![Page 44: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/44.jpg)
Copyright © 2014 Russel Winder 44
Java 8Released
![Page 45: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/45.jpg)
Copyright © 2014 Russel Winder 45
Java 8 is the biggest revolution in Java since 1994.
Bigger than Java 5.
![Page 46: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/46.jpg)
Copyright © 2014 Russel Winder 46
Has Java revived?
Is this a new lease of life?
![Page 47: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/47.jpg)
Copyright © 2014 Russel Winder 47
What's Interesting in Java 8?
● G1 garbage collector.
● Nashorn.
● JavaFX.
● Lambda expressions.
● Default methods in interfaces (traits).
● Enhanced collections.
![Page 48: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/48.jpg)
Copyright © 2014 Russel Winder 48
G1 garbage collector is now the standard: no more PermGen.
![Page 49: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/49.jpg)
Copyright © 2014 Russel Winder 49
Nashorn comes as standard:Server-side JavaScript without Rhino.
![Page 50: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/50.jpg)
Copyright © 2014 Russel Winder 50
JavaFX in the distribution:you will want to use GroovyFX though.
![Page 51: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/51.jpg)
Copyright © 2014 Russel Winder 51
Lambda expressions,default methods in interfaces,
associated collections enhancements.
![Page 52: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/52.jpg)
Copyright © 2014 Russel Winder 52
Code!
![Page 53: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/53.jpg)
Copyright © 2014 Russel Winder 53
![Page 54: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/54.jpg)
Copyright © 2014 Russel Winder 54
Code!
![Page 55: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/55.jpg)
Copyright © 2014 Russel Winder 55
Java is DeadLong Live Scala, Kotlin, Ceylon,
etc.
Russel Winder
email: [email protected]: [email protected]
twitter: @russel_winderWeb: http://www.russel.org.uk
![Page 56: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/56.jpg)
Copyright © 2014 Russel Winder 56
Java is DeadLong Live Java
Russel Winder
email: [email protected]: [email protected]
twitter: @russel_winderWeb: http://www.russel.org.uk
![Page 57: Java is dead, long live Scala Kotlin Ceylon etc](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d1c40b379597b2b8b5189/html5/thumbnails/57.jpg)
Copyright © 2014 Russel Winder 57
Java is DeadLong Live Groovy
Russel Winder
email: [email protected]: [email protected]
twitter: @russel_winderWeb: http://www.russel.org.uk