SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
A Shallow Survey of Alternative
    Languages on the JVM
        Charles Anderson
          March 2013
Introduction
● Survey a few languages on the JVM
  ○ Some philosophy of those languages
● Discuss the value of the Java Platform
● These concepts are applicable to other VM-
  based platforms - e.g., Microsoft
The Java Language
●   Been around for almost 20 years
●   Verbose
●   Slow to execute
●   Slow to start-up
●   Slow to evolve
●   Very widely used
Ported Languages
● A language that was originally implemented
  elsewhere - probably C/C++
● Common examples include : JRuby, Jython,
  Jacl
● Others (from Wikipedia): Ada, Fortran,
  Cobol, Go, etc.
Why?
● Because I can
● Research
● Easier than writing to bare metal or C
  ○ C is portable assembly
  ○ Java is the new C?
● To leverage the Java Platform
The Java Platform
● Java the language
● Java libraries - To Leverage Enterprise
  Synergies of Multi-vendor, Standards-
  compliant, Powerpoint slide decks
● Java Virtual Machine
  ○ Performance - JIT
  ○ Garbage collection
  ○ Threading
● Tools
● There's a reason Twitter moved a lot of their
  system to the JVM
Best of Both Worlds
● Get to write in a cool, "new" language (e.g.
  Ruby) without leaving the benefits of the
  Java Platform
● Many such languages include a REPL
● You can use cool frameworks (e.g.
  Cucumber or web apps) with your Java code
Issues with Ported Languages
● Owe allegiance to the mother language
   ○ Leads to impedance mismatches - e.g., JRuby
● Usually, can call into Java easily, but can run
  into problems with other combinations - e.g.,
  inheritance
● Performance - improving (invoke dynamic)
New Languages: Groovy
● Starting from Java, add cool stuff, cut down
  on boilerplate - easy transition for Java
  programmers
● Strives to be compatible with Java/Platform
● Cool playground for future features of the
  Java language - e.g., closures
● http://groovy.codehaus.org/
Java or Groovy?
class Book {
   private String title;
   Book (String theTitle) {
      title = theTitle;
   }
   String getTitle() {
      return title
   }
}
Stupid Pet Tricks
println ‘Hello World’

class MyBean implements Serializable {
    String myProp
}

Thread.start { /* some code */ }

coll.each { item-> /* some code */ }

coll.findAll { it % 2 == 0 }.each{ ... }

new File(‘foo.txt’).eachLine { println it }
New Languages: Mirah
● Start with Ruby and move back towards
  Java
  ○ static typing and type inference
  ○ no attempt at Ruby compatibility - no Rails
  ○ macros and meta-programming
● Very immature - v. 0.1 recently release
● http://www.mirah.org/
Little Sample of Mirah
def printN(str:String, n:int)
 n.times do
  puts str
 end
end
New Languages: Scala
● Let's create a brand new language
● A hybrid of object-oriented and functional
   ○ Functional is important for multi-core
● Statically typed with a "dynamic" feel
● Still very compatible with Java/Platform
● http://www.scala-lang.org/
Samples of Scala
class Point (var x:int, var y:int)

employees.sort (_.age > _.age)

val s = for (x <- 1 to 25 if x*x > 50) yield 2*x
Other New Languages
● Clojure - LISP, functional
● Koitlin - compiles to Java or JavaScript
  (from JetBrains/IntelliJ)
● Ceylon from RedHat
Conclusion
● You don't have to program in Java to get the
  benefit of the Java Platform
● Classic Trojan horse strategy - testing or
  other "utility" programming
  ○   not production
  ○   not performance critical
  ○   more productive testing means more real code
  ○   just a jar file

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Protocol buffers
Protocol buffersProtocol buffers
Protocol buffers
 
ActiveDoc
ActiveDocActiveDoc
ActiveDoc
 
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Adopting language server for apache camel  feedback from a java/Eclipse plugi...Adopting language server for apache camel  feedback from a java/Eclipse plugi...
Adopting language server for apache camel feedback from a java/Eclipse plugi...
 
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming Language
 
Experience protocol buffer on android
Experience protocol buffer on androidExperience protocol buffer on android
Experience protocol buffer on android
 
Porting 100k Lines of Code to TypeScript
Porting 100k Lines of Code to TypeScriptPorting 100k Lines of Code to TypeScript
Porting 100k Lines of Code to TypeScript
 
Crystal
CrystalCrystal
Crystal
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Stockholm JAM September 2018
Stockholm JAM September 2018Stockholm JAM September 2018
Stockholm JAM September 2018
 
FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo W...
FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo W...FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo W...
FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo W...
 
Google Go! language
Google Go! languageGoogle Go! language
Google Go! language
 
Go Programming Language by Google
Go Programming Language by GoogleGo Programming Language by Google
Go Programming Language by Google
 
Rubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with RubyRubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with Ruby
 
FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)
 
Go Language presentation
Go Language presentationGo Language presentation
Go Language presentation
 
An introduction to go programming language
An introduction to go programming languageAn introduction to go programming language
An introduction to go programming language
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Scala vs ruby
Scala vs rubyScala vs ruby
Scala vs ruby
 

Destacado (20)

Moss Week 11 Final With Answers
Moss   Week 11   Final   With AnswersMoss   Week 11   Final   With Answers
Moss Week 11 Final With Answers
 
December 2 General Meeting
December 2 General MeetingDecember 2 General Meeting
December 2 General Meeting
 
Above quiz prelims with answers nov 2010
Above quiz prelims with answers nov 2010Above quiz prelims with answers nov 2010
Above quiz prelims with answers nov 2010
 
Docker - Hack Salem! - November 2014
Docker - Hack Salem! - November 2014Docker - Hack Salem! - November 2014
Docker - Hack Salem! - November 2014
 
扮演称职的听讲人
扮演称职的听讲人扮演称职的听讲人
扮演称职的听讲人
 
水煮西游记
水煮西游记水煮西游记
水煮西游记
 
0010
00100010
0010
 
8020法则.
8020法则.8020法则.
8020法则.
 
职前培训安排(好)
职前培训安排(好)职前培训安排(好)
职前培训安排(好)
 
Situational 情景领导
Situational 情景领导Situational 情景领导
Situational 情景领导
 
Clip
ClipClip
Clip
 
企业人力资源管理
企业人力资源管理企业人力资源管理
企业人力资源管理
 
聚成团队复制之人员招聘
聚成团队复制之人员招聘聚成团队复制之人员招聘
聚成团队复制之人员招聘
 
7
77
7
 
职业经理人的心态与解压
职业经理人的心态与解压职业经理人的心态与解压
职业经理人的心态与解压
 
2009 年的祝福1
2009 年的祝福12009 年的祝福1
2009 年的祝福1
 
启迪培训公司
启迪培训公司启迪培训公司
启迪培训公司
 
图表绘制
图表绘制图表绘制
图表绘制
 
一流企业员工应具备的心态
一流企业员工应具备的心态一流企业员工应具备的心态
一流企业员工应具备的心态
 
如何培养积极的心态
如何培养积极的心态如何培养积极的心态
如何培养积极的心态
 

Similar a A Shallow Survey of Alternative Languages on the JVM

Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
umoren
 
Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
Eric Evans
 

Similar a A Shallow Survey of Alternative Languages on the JVM (20)

Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - Mindbowser
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012Teaching Functional Programming @ TCD - 11/2012
Teaching Functional Programming @ TCD - 11/2012
 
OOP - Lecture02 - Introduction to Java.pptx
OOP - Lecture02 - Introduction to Java.pptxOOP - Lecture02 - Introduction to Java.pptx
OOP - Lecture02 - Introduction to Java.pptx
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac x
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript Developers
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
 
Scala.js
Scala.js Scala.js
Scala.js
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Why Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalkWhy Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalk
 
The Rise of Functional Programming
The Rise of Functional ProgrammingThe Rise of Functional Programming
The Rise of Functional Programming
 
Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary
 
[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in action[EclipseCon France 2017] Language Server Protocol in action
[EclipseCon France 2017] Language Server Protocol in action
 

Más de Charles Anderson

Más de Charles Anderson (9)

Modern php
Modern phpModern php
Modern php
 
Literate Programming
Literate ProgrammingLiterate Programming
Literate Programming
 
Inrastructure as Code
Inrastructure as CodeInrastructure as Code
Inrastructure as Code
 
How to get a Software Job w/o Experience
How to get a Software Job w/o ExperienceHow to get a Software Job w/o Experience
How to get a Software Job w/o Experience
 
A Brief Introduction to Redis
A Brief Introduction to RedisA Brief Introduction to Redis
A Brief Introduction to Redis
 
How to Get a Software Job w/o Experience
How to Get a Software Job w/o ExperienceHow to Get a Software Job w/o Experience
How to Get a Software Job w/o Experience
 
How To Protect Yourself and Your Computer Online
How To Protect Yourself and Your Computer OnlineHow To Protect Yourself and Your Computer Online
How To Protect Yourself and Your Computer Online
 
Jython: Integrating Python and Java
Jython: Integrating Python and JavaJython: Integrating Python and Java
Jython: Integrating Python and Java
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for Java
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

A Shallow Survey of Alternative Languages on the JVM

  • 1. A Shallow Survey of Alternative Languages on the JVM Charles Anderson March 2013
  • 2. Introduction ● Survey a few languages on the JVM ○ Some philosophy of those languages ● Discuss the value of the Java Platform ● These concepts are applicable to other VM- based platforms - e.g., Microsoft
  • 3. The Java Language ● Been around for almost 20 years ● Verbose ● Slow to execute ● Slow to start-up ● Slow to evolve ● Very widely used
  • 4. Ported Languages ● A language that was originally implemented elsewhere - probably C/C++ ● Common examples include : JRuby, Jython, Jacl ● Others (from Wikipedia): Ada, Fortran, Cobol, Go, etc.
  • 5. Why? ● Because I can ● Research ● Easier than writing to bare metal or C ○ C is portable assembly ○ Java is the new C? ● To leverage the Java Platform
  • 6. The Java Platform ● Java the language ● Java libraries - To Leverage Enterprise Synergies of Multi-vendor, Standards- compliant, Powerpoint slide decks ● Java Virtual Machine ○ Performance - JIT ○ Garbage collection ○ Threading ● Tools ● There's a reason Twitter moved a lot of their system to the JVM
  • 7. Best of Both Worlds ● Get to write in a cool, "new" language (e.g. Ruby) without leaving the benefits of the Java Platform ● Many such languages include a REPL ● You can use cool frameworks (e.g. Cucumber or web apps) with your Java code
  • 8. Issues with Ported Languages ● Owe allegiance to the mother language ○ Leads to impedance mismatches - e.g., JRuby ● Usually, can call into Java easily, but can run into problems with other combinations - e.g., inheritance ● Performance - improving (invoke dynamic)
  • 9. New Languages: Groovy ● Starting from Java, add cool stuff, cut down on boilerplate - easy transition for Java programmers ● Strives to be compatible with Java/Platform ● Cool playground for future features of the Java language - e.g., closures ● http://groovy.codehaus.org/
  • 10. Java or Groovy? class Book { private String title; Book (String theTitle) { title = theTitle; } String getTitle() { return title } }
  • 11. Stupid Pet Tricks println ‘Hello World’ class MyBean implements Serializable { String myProp } Thread.start { /* some code */ } coll.each { item-> /* some code */ } coll.findAll { it % 2 == 0 }.each{ ... } new File(‘foo.txt’).eachLine { println it }
  • 12. New Languages: Mirah ● Start with Ruby and move back towards Java ○ static typing and type inference ○ no attempt at Ruby compatibility - no Rails ○ macros and meta-programming ● Very immature - v. 0.1 recently release ● http://www.mirah.org/
  • 13. Little Sample of Mirah def printN(str:String, n:int) n.times do puts str end end
  • 14. New Languages: Scala ● Let's create a brand new language ● A hybrid of object-oriented and functional ○ Functional is important for multi-core ● Statically typed with a "dynamic" feel ● Still very compatible with Java/Platform ● http://www.scala-lang.org/
  • 15. Samples of Scala class Point (var x:int, var y:int) employees.sort (_.age > _.age) val s = for (x <- 1 to 25 if x*x > 50) yield 2*x
  • 16. Other New Languages ● Clojure - LISP, functional ● Koitlin - compiles to Java or JavaScript (from JetBrains/IntelliJ) ● Ceylon from RedHat
  • 17. Conclusion ● You don't have to program in Java to get the benefit of the Java Platform ● Classic Trojan horse strategy - testing or other "utility" programming ○ not production ○ not performance critical ○ more productive testing means more real code ○ just a jar file