SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
It’s Java, Jim, But Not
As We Know It!
Simon Ritter
Deputy CTO, Azul Systems
1
© Copyright Azul Systems 2017
Agenda
 Java Lambda expressions
 Lambda expression performance
 How far can we take lambdas?
 Summary
2
© Copyright Azul Systems 2017
Java Lambda Expressions
© Copyright Azul Systems 2017
JDK 8 Lambda Expressions
 Simplified representation of behaviour in Java
– Anonymous inner class is clunky
 Assign to variable, pass as parameter
 Use wherever the type is a Functional Interface
– Much simpler than adding a function type to Java
– Single abstract method
– Not necessarily single method
 default and static methods don’t count
4
© Copyright Azul Systems 2017
Lambda Expression Syntax
 Like a method
– But not associated with a class
– Typed parameters, body, return type, exceptions
 Closure over values, not types
– Only capture effectively-final variables
5
(parameters) -> body
Lambda operator
© Copyright Azul Systems 2017
Capturing Lambdas
6
class DataProcessor {
private int currentValue;
public void process() {
DataSet myData = myFactory.getDataSet();
dataSet.forEach(d -> d.use(currentValue++));
}
}
© Copyright Azul Systems 2017
Capturing Lambdas
7
class DataProcessor {
private int currentValue;
public void process() {
DataSet myData = myFactory.getDataSet();
dataSet.forEach(d -> d.use(this.currentValue++));
}
}
Reference to this inserted
by compiler
© Copyright Azul Systems 2017
Method References
 Method references let us reuse a method as a lambda
expression
FileFilter x = File f -> f.canRead();
FileFilter x = File::canRead;
© Copyright Azul Systems 2017
Method References
 Format: target_reference::method_name
 Three kinds of method reference
– Static method
– Instance method of an arbitrary type
– Instance method of an existing object
9
© Copyright Azul Systems 2017
Method References
10
Lambda
Method Ref
Lambda
Method Ref
Lambda
Method Ref
(args) -> ClassName.staticMethod(args)
(arg0, rest) -> arg0.instanceMethod(rest)
(args) -> expr.instanceMethod(args)
ClassName::staticMethod
ClassName::instanceMethod
expr::instanceMethod
Rules For Construction
© Copyright Azul Systems 2017
Method References
(String s) -> Integer.parseInt(s);
(String s, int i) -> s.substring(i)
Axis a -> getLength(a)
Integer::parseInt
String::substring
this::getLength
Lambda
Method Ref
Lambda
Method Ref
Lambda
Method Ref
Examples
© Copyright Azul Systems 2017
Lambda Expression
Performance
© Copyright Azul Systems 2017
Lambdas & Anonymous Inner Classes
 Functionally equivalent
13
myList.forEach(w -> System.out.println(w));
myList.forEach(new Consumer<String>() {
@Override
public void accept(String w) {
System.out.println(w);
}
});
myList.forEach(System.out::println);
© Copyright Azul Systems 2017
Anonymous Inner Classes
 As the name suggests, we are dealing with classes
– Compiler generates class with name like Foo$1
– Type pollution
 The class must be loaded at run time
 Instantiated like any other class
 Lambda expressions could be implemented this way
– Originally they were
– Forces an inner class where you didn’t ask for it
 You wanted a function
14
© Copyright Azul Systems 2017
Lambda Implementation
 A better answer: invokedynamic
– Introduced in Java SE 7 to improve performance of
dynamically typed languages running on the JVM
– Defers implementation of the Lambda to runtime
 Lambda compilation
– Generate invokedynamic call (lambda factory)
 java.lang.LambdaMetaFactory
 Return instance of (lambda) functional interface type
– Convert body of lambda to method
 Not necessary for method references
15
© Copyright Azul Systems 2017
Lambda Implementation
 Non-capturing Lambda
– Simple conversion to static method in the class where the
lambda is used
 Capturing Lambdas
– Static method with captured variables prepended as
parameters
– Synthetic instance method of class using Lambda
 Lambda invokes a class method
16
© Copyright Azul Systems 2017
Implementation Differences
 Lambdas
– Linkage (CallSite)
– Capture
– Invocation
17
 Anonymous inner classes
– Class loading
– Instantiation
– Invocation
 Non-capturing lambdas automatically optimise
 Method references are slightly more optimal
 -XX:+TieredCompilation gives better Lambda results
– Advice is don’t use -XX:-TieredCompilation
© Copyright Azul Systems 2017
How Far Can We Take
Lambdas?
With inspiration from Jarek Ratajski
© Copyright Azul Systems 2017 19
Alonso Church
The λ Calculus (1936)
What does this have to do with Java?
© Copyright Azul Systems 2017
Exploding Head Lambdas
 Java programmers are typically imperative programmers
 Functional programming is not imperative
– As we’ll see
 Lambda Calculus and Turing Machines are equivalent
 But will give you a headache
– At least it did me!
 What can we do only using Lambda expressions?
– And one functional interface
20
© Copyright Azul Systems 2017
Functional Interface
@FunctionalInterface
public interface Lambda {
Lambda apply(Lambda lambda);
}
© Copyright Azul Systems 2017
Function Basics
 Identity [ λx.x ]
Lambda identity = x -> x;
Lambda identity = new Lambda {
Lambda apply(Lambda x) {
return x;
}
};
© Copyright Azul Systems 2017
Function Basics (Booleans)
 Boolean false [ λf.λx.x ]
boolFalse = f -> (x -> x); // Always returns identity
boolFalse = new Lambda {
Lambda apply(Lambda f) {
return new Lambda {
Lambda apply(Lambda x) {
return x;
}
}}};
© Copyright Azul Systems 2017
Function Basics (Booleans)
 Boolean true [ λf.λx.f ]
boolTrue = f -> (x -> f); // Never returns identity
boolTrue = new Lambda {
Lambda apply(Lambda f) {
return new Lambda {
Lambda apply(Lambda x) {
return f;
}
}}};
© Copyright Azul Systems 2017
Church Numerals
 Zero [ λf.λx.x ]
• Identity for addition and subtraction (a ± 0 = a)
• The Lambda is the same as false
• The function is applied zero times to the argument
zero = f -> x -> x;
 One [ λf.λx.(f x) ]
one = f -> x -> f.apply(x);
 Two [ λf.λx.(f (f x)) ]
two = f -> x -> f.apply(f.apply(x));
25
© Copyright Azul Systems 2017
Church Encoding
 Successor: n++ [ λn.λf.λx.f(n f x) ]
successor =
n -> f -> x -> f.apply(n.apply(f).apply(x));
26
© Copyright Azul Systems 2017
Church Encoding
 Predecessor: n--
27
predecessor = n -> f -> x ->
n.apply(g -> h -> h.apply(g.apply(f)))
.apply(u -> x).apply(u -> u);
[ λn.λf.λx.n(λg.λh.h(g f))(λu.x)(λu.u) ]
© Copyright Azul Systems 2017
Church Encoding
 Add: m + n [ λm.λn.λf.λx ((m f) ((n f) x)) ]
m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x))
 Subtract: m - n [ λm.λn.(n predecessor) m ]
m -> n -> m.apply(predecessor).apply(n)
28
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
Lambda two = f -> x -> f.apply(f.apply(x));
Lambda plus = m -> n ->
f -> x -> m.apply(f).apply(n.apply(f).apply(x));
Lambda four = plus.apply(two).apply(two);
4 = + 2 2 (Polish notation)
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x))
n -> f -> x -> f -> x -> f.apply(f.apply(x)).apply(f)
.apply(n.apply(f).apply(x))
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x))
n -> f -> x -> f -> x -> f.apply(f.apply(x)).apply(f)
.apply(n.apply(f).apply(x))
f -> x -> f -> x -> f.apply(f.apply(x)).apply(f)
.apply(f -> x -> f.apply(f.apply(x).apply(f).apply(x))
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
f -> x ->
f -> x -> f.apply(f.apply(x)).apply(f)
.apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x))
f -> x ->
x -> f.apply(f.apply(x))
.apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x))
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
f -> x ->
f -> x -> f.apply(f.apply(x)).apply(f)
.apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x))
f -> x ->
x -> f.apply(f.apply(x))
.apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x))
f -> x ->
x -> f.apply(f.apply(x))
.apply(x -> f.apply(f.apply(x)).apply(x))
© Copyright Azul Systems 2017
Solving 2 + 2 With Lambdas
f -> x -> x -> f.apply(f.apply(x))
.apply(x -> f.apply(f.apply(x)).apply(x))
f -> x -> x -> f.apply(f.apply(x))
.apply(f.apply(f.apply(x)))
f -> x -> x -> f.apply(f.apply(x))
.apply(f.apply(f.apply(x)))
f -> x -> f.apply(f.apply(f.apply(f.apply(x))) = 4!
© Copyright Azul Systems 2017
Summary
© Copyright Azul Systems 2017
Lambda Expressions
 Very useful and powerful
– Succinct way to parameterise behaviour
 Better performance than anonymous inner class
– Invokedynamic implementation
 Can be used in weird and wonderful ways
– Not necessarily to be recommended!
36
© Copyright Azul Systems 2017
More Information
 Dixin Yan’s blog
– weblogs.asp.net/dixin (C# based, but useful)
– October 2016
 Jarek’s presentation from Voxxed Zurich
– https://www.youtube.com/watch?v=Dun8ewSeX6c
37
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
It’s Java, Jim, But Not
As We Know It!
Simon Ritter
Deputy CTO, Azul Systems
38

Contenu connexe

Tendances

Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterJAXLondon2014
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern JavaSimon Ritter
 
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and Cassandra
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and CassandraBrief introduction on Hadoop,Dremel, Pig, FlumeJava and Cassandra
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and CassandraSomnath Mazumdar
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David SzakallasDatabricks
 
An Introduction to Higher Order Functions in Spark SQL with Herman van Hovell
An Introduction to Higher Order Functions in Spark SQL with Herman van HovellAn Introduction to Higher Order Functions in Spark SQL with Herman van Hovell
An Introduction to Higher Order Functions in Spark SQL with Herman van HovellDatabricks
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams IndicThreads
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJavaJobaer Chowdhury
 
Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kros Huang
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingIndicThreads
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTechTalks
 
Spark Summit EU talk by Nimbus Goehausen
Spark Summit EU talk by Nimbus GoehausenSpark Summit EU talk by Nimbus Goehausen
Spark Summit EU talk by Nimbus GoehausenSpark Summit
 
Spark Schema For Free with David Szakallas
 Spark Schema For Free with David Szakallas Spark Schema For Free with David Szakallas
Spark Schema For Free with David SzakallasDatabricks
 
CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)Ortus Solutions, Corp
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit
 
Shooting the Rapids: Getting the Best from Java 8 Streams
Shooting the Rapids: Getting the Best from Java 8 StreamsShooting the Rapids: Getting the Best from Java 8 Streams
Shooting the Rapids: Getting the Best from Java 8 StreamsMaurice Naftalin
 
あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法x1 ichi
 

Tendances (20)

Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterLambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon Ritter
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and Cassandra
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and CassandraBrief introduction on Hadoop,Dremel, Pig, FlumeJava and Cassandra
Brief introduction on Hadoop,Dremel, Pig, FlumeJava and Cassandra
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David Szakallas
 
An Introduction to Higher Order Functions in Spark SQL with Herman van Hovell
An Introduction to Higher Order Functions in Spark SQL with Herman van HovellAn Introduction to Higher Order Functions in Spark SQL with Herman van Hovell
An Introduction to Higher Order Functions in Spark SQL with Herman van Hovell
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJava
 
Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹Kotlin Receiver Types 介紹
Kotlin Receiver Types 介紹
 
Java 8
Java 8Java 8
Java 8
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before Reacting
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
 
Spark Summit EU talk by Nimbus Goehausen
Spark Summit EU talk by Nimbus GoehausenSpark Summit EU talk by Nimbus Goehausen
Spark Summit EU talk by Nimbus Goehausen
 
R and C++
R and C++R and C++
R and C++
 
Spark Schema For Free with David Szakallas
 Spark Schema For Free with David Szakallas Spark Schema For Free with David Szakallas
Spark Schema For Free with David Szakallas
 
Shooting the Rapids
Shooting the RapidsShooting the Rapids
Shooting the Rapids
 
CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
Shooting the Rapids: Getting the Best from Java 8 Streams
Shooting the Rapids: Getting the Best from Java 8 StreamsShooting the Rapids: Getting the Best from Java 8 Streams
Shooting the Rapids: Getting the Best from Java 8 Streams
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the Rapids
 
あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法
 

En vedette

55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9Simon Ritter
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Simon Ritter
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9Simon Ritter
 
JDays 2016 - Beyond Lambdas - the Aftermath
JDays 2016 - Beyond Lambdas - the AftermathJDays 2016 - Beyond Lambdas - the Aftermath
JDays 2016 - Beyond Lambdas - the AftermathDaniel Sawano
 
Reducing technical debt in php
Reducing technical debt in phpReducing technical debt in php
Reducing technical debt in phpCarola Lilienthal
 
Its all about the domain honey
Its all about the domain honeyIts all about the domain honey
Its all about the domain honeyCarola Lilienthal
 
Javaland 2017: "You´ll do microservices now". Now what?
Javaland 2017: "You´ll do microservices now". Now what?Javaland 2017: "You´ll do microservices now". Now what?
Javaland 2017: "You´ll do microservices now". Now what?André Goliath
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaSimon Ritter
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenCarola Lilienthal
 
Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Simon Ritter
 
Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014Simon Ritter
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Simon Ritter
 
AppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete GuideAppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete GuideTakipi
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8Martin Toshev
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8Simon Ritter
 

En vedette (20)

55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
JDays 2016 - Beyond Lambdas - the Aftermath
JDays 2016 - Beyond Lambdas - the AftermathJDays 2016 - Beyond Lambdas - the Aftermath
JDays 2016 - Beyond Lambdas - the Aftermath
 
Reducing technical debt in php
Reducing technical debt in phpReducing technical debt in php
Reducing technical debt in php
 
Its all about the domain honey
Its all about the domain honeyIts all about the domain honey
Its all about the domain honey
 
Javaland 2017: "You´ll do microservices now". Now what?
Javaland 2017: "You´ll do microservices now". Now what?Javaland 2017: "You´ll do microservices now". Now what?
Javaland 2017: "You´ll do microservices now". Now what?
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
 
Langlebige architekturen
Langlebige architekturenLanglebige architekturen
Langlebige architekturen
 
Technische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigenTechnische Schulden in Architekturen erkennen und beseitigen
Technische Schulden in Architekturen erkennen und beseitigen
 
The Java Carputer
The Java CarputerThe Java Carputer
The Java Carputer
 
Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8
 
Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014Oracle Keynote from JMagghreb 2014
Oracle Keynote from JMagghreb 2014
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
 
AppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete GuideAppDynamics VS New Relic – The Complete Guide
AppDynamics VS New Relic – The Complete Guide
 
55 New Features in Java 7
55 New Features in Java 755 New Features in Java 7
55 New Features in Java 7
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 

Similaire à It's Java Jim, But Not As We Know It!

Lambda expressions
Lambda expressionsLambda expressions
Lambda expressionsDoron Gold
 
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017Amazon Web Services
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with RMartin Jung
 
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Frederic Descamps
 
Serverless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicesServerless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicessaifam
 
What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8Dian Aditya
 
20180420 hk-the powerofmysql8
20180420 hk-the powerofmysql820180420 hk-the powerofmysql8
20180420 hk-the powerofmysql8Ivan Ma
 
Time series modeling workd AMLD 2018 Lausanne
Time series modeling workd AMLD 2018 LausanneTime series modeling workd AMLD 2018 Lausanne
Time series modeling workd AMLD 2018 LausanneSunil Mallya
 
Serverless Architecture - A Gentle Overview
Serverless Architecture - A Gentle OverviewServerless Architecture - A Gentle Overview
Serverless Architecture - A Gentle OverviewCodeOps Technologies LLP
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 itiAhmed mar3y
 
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleDEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleAmazon Web Services
 
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...Amazon Web Services
 
Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018AWS Germany
 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8IndicThreads
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...jaxLondonConference
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017Amazon Web Services
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfAmazon Web Services
 

Similaire à It's Java Jim, But Not As We Know It! (20)

Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
 
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017
Big Data, Analytics and Machine Learning on AWS Lambda - SRV402 - re:Invent 2017
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with R
 
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
 
Serverless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicesServerless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practices
 
What's new in java 8
What's new in java 8What's new in java 8
What's new in java 8
 
20180420 hk-the powerofmysql8
20180420 hk-the powerofmysql820180420 hk-the powerofmysql8
20180420 hk-the powerofmysql8
 
Time series modeling workd AMLD 2018 Lausanne
Time series modeling workd AMLD 2018 LausanneTime series modeling workd AMLD 2018 Lausanne
Time series modeling workd AMLD 2018 Lausanne
 
Serverless Architecture - A Gentle Overview
Serverless Architecture - A Gentle OverviewServerless Architecture - A Gentle Overview
Serverless Architecture - A Gentle Overview
 
Apouc 2014-java-8-create-the-future
Apouc 2014-java-8-create-the-futureApouc 2014-java-8-create-the-future
Apouc 2014-java-8-create-the-future
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
 
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleDEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
 
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...
Authoring and Deploying Serverless Applications with AWS SAM - SRV311 - re:In...
 
What`s New in Java 8
What`s New in Java 8What`s New in Java 8
What`s New in Java 8
 
Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018
 
MBrace: Cloud Computing with F#
MBrace: Cloud Computing with F#MBrace: Cloud Computing with F#
MBrace: Cloud Computing with F#
 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 

Plus de Simon Ritter

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native CompilerSimon Ritter
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type PatternsSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVMSimon Ritter
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New FeaturesSimon Ritter
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDKSimon Ritter
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologySimon Ritter
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologySimon Ritter
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?Simon Ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12Simon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still FreeSimon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveSimon Ritter
 

Plus de Simon Ritter (20)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
 
JDK 9 Deep Dive
JDK 9 Deep DiveJDK 9 Deep Dive
JDK 9 Deep Dive
 

Dernier

Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxSasikiranMarri
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 

Dernier (20)

Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 

It's Java Jim, But Not As We Know It!

  • 1. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava It’s Java, Jim, But Not As We Know It! Simon Ritter Deputy CTO, Azul Systems 1
  • 2. © Copyright Azul Systems 2017 Agenda  Java Lambda expressions  Lambda expression performance  How far can we take lambdas?  Summary 2
  • 3. © Copyright Azul Systems 2017 Java Lambda Expressions
  • 4. © Copyright Azul Systems 2017 JDK 8 Lambda Expressions  Simplified representation of behaviour in Java – Anonymous inner class is clunky  Assign to variable, pass as parameter  Use wherever the type is a Functional Interface – Much simpler than adding a function type to Java – Single abstract method – Not necessarily single method  default and static methods don’t count 4
  • 5. © Copyright Azul Systems 2017 Lambda Expression Syntax  Like a method – But not associated with a class – Typed parameters, body, return type, exceptions  Closure over values, not types – Only capture effectively-final variables 5 (parameters) -> body Lambda operator
  • 6. © Copyright Azul Systems 2017 Capturing Lambdas 6 class DataProcessor { private int currentValue; public void process() { DataSet myData = myFactory.getDataSet(); dataSet.forEach(d -> d.use(currentValue++)); } }
  • 7. © Copyright Azul Systems 2017 Capturing Lambdas 7 class DataProcessor { private int currentValue; public void process() { DataSet myData = myFactory.getDataSet(); dataSet.forEach(d -> d.use(this.currentValue++)); } } Reference to this inserted by compiler
  • 8. © Copyright Azul Systems 2017 Method References  Method references let us reuse a method as a lambda expression FileFilter x = File f -> f.canRead(); FileFilter x = File::canRead;
  • 9. © Copyright Azul Systems 2017 Method References  Format: target_reference::method_name  Three kinds of method reference – Static method – Instance method of an arbitrary type – Instance method of an existing object 9
  • 10. © Copyright Azul Systems 2017 Method References 10 Lambda Method Ref Lambda Method Ref Lambda Method Ref (args) -> ClassName.staticMethod(args) (arg0, rest) -> arg0.instanceMethod(rest) (args) -> expr.instanceMethod(args) ClassName::staticMethod ClassName::instanceMethod expr::instanceMethod Rules For Construction
  • 11. © Copyright Azul Systems 2017 Method References (String s) -> Integer.parseInt(s); (String s, int i) -> s.substring(i) Axis a -> getLength(a) Integer::parseInt String::substring this::getLength Lambda Method Ref Lambda Method Ref Lambda Method Ref Examples
  • 12. © Copyright Azul Systems 2017 Lambda Expression Performance
  • 13. © Copyright Azul Systems 2017 Lambdas & Anonymous Inner Classes  Functionally equivalent 13 myList.forEach(w -> System.out.println(w)); myList.forEach(new Consumer<String>() { @Override public void accept(String w) { System.out.println(w); } }); myList.forEach(System.out::println);
  • 14. © Copyright Azul Systems 2017 Anonymous Inner Classes  As the name suggests, we are dealing with classes – Compiler generates class with name like Foo$1 – Type pollution  The class must be loaded at run time  Instantiated like any other class  Lambda expressions could be implemented this way – Originally they were – Forces an inner class where you didn’t ask for it  You wanted a function 14
  • 15. © Copyright Azul Systems 2017 Lambda Implementation  A better answer: invokedynamic – Introduced in Java SE 7 to improve performance of dynamically typed languages running on the JVM – Defers implementation of the Lambda to runtime  Lambda compilation – Generate invokedynamic call (lambda factory)  java.lang.LambdaMetaFactory  Return instance of (lambda) functional interface type – Convert body of lambda to method  Not necessary for method references 15
  • 16. © Copyright Azul Systems 2017 Lambda Implementation  Non-capturing Lambda – Simple conversion to static method in the class where the lambda is used  Capturing Lambdas – Static method with captured variables prepended as parameters – Synthetic instance method of class using Lambda  Lambda invokes a class method 16
  • 17. © Copyright Azul Systems 2017 Implementation Differences  Lambdas – Linkage (CallSite) – Capture – Invocation 17  Anonymous inner classes – Class loading – Instantiation – Invocation  Non-capturing lambdas automatically optimise  Method references are slightly more optimal  -XX:+TieredCompilation gives better Lambda results – Advice is don’t use -XX:-TieredCompilation
  • 18. © Copyright Azul Systems 2017 How Far Can We Take Lambdas? With inspiration from Jarek Ratajski
  • 19. © Copyright Azul Systems 2017 19 Alonso Church The λ Calculus (1936) What does this have to do with Java?
  • 20. © Copyright Azul Systems 2017 Exploding Head Lambdas  Java programmers are typically imperative programmers  Functional programming is not imperative – As we’ll see  Lambda Calculus and Turing Machines are equivalent  But will give you a headache – At least it did me!  What can we do only using Lambda expressions? – And one functional interface 20
  • 21. © Copyright Azul Systems 2017 Functional Interface @FunctionalInterface public interface Lambda { Lambda apply(Lambda lambda); }
  • 22. © Copyright Azul Systems 2017 Function Basics  Identity [ λx.x ] Lambda identity = x -> x; Lambda identity = new Lambda { Lambda apply(Lambda x) { return x; } };
  • 23. © Copyright Azul Systems 2017 Function Basics (Booleans)  Boolean false [ λf.λx.x ] boolFalse = f -> (x -> x); // Always returns identity boolFalse = new Lambda { Lambda apply(Lambda f) { return new Lambda { Lambda apply(Lambda x) { return x; } }}};
  • 24. © Copyright Azul Systems 2017 Function Basics (Booleans)  Boolean true [ λf.λx.f ] boolTrue = f -> (x -> f); // Never returns identity boolTrue = new Lambda { Lambda apply(Lambda f) { return new Lambda { Lambda apply(Lambda x) { return f; } }}};
  • 25. © Copyright Azul Systems 2017 Church Numerals  Zero [ λf.λx.x ] • Identity for addition and subtraction (a ± 0 = a) • The Lambda is the same as false • The function is applied zero times to the argument zero = f -> x -> x;  One [ λf.λx.(f x) ] one = f -> x -> f.apply(x);  Two [ λf.λx.(f (f x)) ] two = f -> x -> f.apply(f.apply(x)); 25
  • 26. © Copyright Azul Systems 2017 Church Encoding  Successor: n++ [ λn.λf.λx.f(n f x) ] successor = n -> f -> x -> f.apply(n.apply(f).apply(x)); 26
  • 27. © Copyright Azul Systems 2017 Church Encoding  Predecessor: n-- 27 predecessor = n -> f -> x -> n.apply(g -> h -> h.apply(g.apply(f))) .apply(u -> x).apply(u -> u); [ λn.λf.λx.n(λg.λh.h(g f))(λu.x)(λu.u) ]
  • 28. © Copyright Azul Systems 2017 Church Encoding  Add: m + n [ λm.λn.λf.λx ((m f) ((n f) x)) ] m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x))  Subtract: m - n [ λm.λn.(n predecessor) m ] m -> n -> m.apply(predecessor).apply(n) 28
  • 29. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas Lambda two = f -> x -> f.apply(f.apply(x)); Lambda plus = m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x)); Lambda four = plus.apply(two).apply(two); 4 = + 2 2 (Polish notation)
  • 30. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x)) n -> f -> x -> f -> x -> f.apply(f.apply(x)).apply(f) .apply(n.apply(f).apply(x))
  • 31. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas m -> n -> f -> x -> m.apply(f).apply(n.apply(f).apply(x)) n -> f -> x -> f -> x -> f.apply(f.apply(x)).apply(f) .apply(n.apply(f).apply(x)) f -> x -> f -> x -> f.apply(f.apply(x)).apply(f) .apply(f -> x -> f.apply(f.apply(x).apply(f).apply(x))
  • 32. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas f -> x -> f -> x -> f.apply(f.apply(x)).apply(f) .apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x)) f -> x -> x -> f.apply(f.apply(x)) .apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x))
  • 33. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas f -> x -> f -> x -> f.apply(f.apply(x)).apply(f) .apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x)) f -> x -> x -> f.apply(f.apply(x)) .apply(f -> x -> f.apply(f.apply(x)).apply(f).apply(x)) f -> x -> x -> f.apply(f.apply(x)) .apply(x -> f.apply(f.apply(x)).apply(x))
  • 34. © Copyright Azul Systems 2017 Solving 2 + 2 With Lambdas f -> x -> x -> f.apply(f.apply(x)) .apply(x -> f.apply(f.apply(x)).apply(x)) f -> x -> x -> f.apply(f.apply(x)) .apply(f.apply(f.apply(x))) f -> x -> x -> f.apply(f.apply(x)) .apply(f.apply(f.apply(x))) f -> x -> f.apply(f.apply(f.apply(f.apply(x))) = 4!
  • 35. © Copyright Azul Systems 2017 Summary
  • 36. © Copyright Azul Systems 2017 Lambda Expressions  Very useful and powerful – Succinct way to parameterise behaviour  Better performance than anonymous inner class – Invokedynamic implementation  Can be used in weird and wonderful ways – Not necessarily to be recommended! 36
  • 37. © Copyright Azul Systems 2017 More Information  Dixin Yan’s blog – weblogs.asp.net/dixin (C# based, but useful) – October 2016  Jarek’s presentation from Voxxed Zurich – https://www.youtube.com/watch?v=Dun8ewSeX6c 37
  • 38. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava It’s Java, Jim, But Not As We Know It! Simon Ritter Deputy CTO, Azul Systems 38

Notes de l'éditeur

  1. ISOMORPHIC Libraries are backwardly compatible