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 Platf...
The Java Language●   Been around for almost 20 years●   Verbose●   Slow to execute●   Slow to start-up●   Slow to evolve● ...
Ported Languages● A language that was originally implemented  elsewhere - probably C/C++● Common examples include : JRuby,...
Why?● Because I can● Research● Easier than writing to bare metal or C  ○ C is portable assembly  ○ Java is the new C?● To ...
The Java Platform● Java the language● Java libraries - To Leverage Enterprise  Synergies of Multi-vendor, Standards-  comp...
Best of Both Worlds● Get to write in a cool, "new" language (e.g.  Ruby) without leaving the benefits of the  Java Platfor...
Issues with Ported Languages● Owe allegiance to the mother language   ○ Leads to impedance mismatches - e.g., JRuby● Usual...
New Languages: Groovy● Starting from Java, add cool stuff, cut down  on boilerplate - easy transition for Java  programmer...
Java or Groovy?class Book {   private String title;   Book (String theTitle) {      title = theTitle;   }   String getTitl...
Stupid Pet Tricksprintln ‘Hello World’class MyBean implements Serializable {    String myProp}Thread.start { /* some code ...
New Languages: Mirah● Start with Ruby and move back towards  Java  ○ static typing and type inference  ○ no attempt at Rub...
Little Sample of Mirahdef printN(str:String, n:int) n.times do  puts str endend
New Languages: Scala● Lets create a brand new language● A hybrid of object-oriented and functional   ○ Functional is impor...
Samples of Scalaclass Point (var x:int, var y:int)employees.sort (_.age > _.age)val s = for (x <- 1 to 25 if x*x > 50) yie...
Other New Languages● Clojure - LISP, functional● Koitlin - compiles to Java or JavaScript  (from JetBrains/IntelliJ)● Ceyl...
Conclusion● You dont have to program in Java to get the  benefit of the Java Platform● Classic Trojan horse strategy - tes...
Upcoming SlideShare
Loading in …5
×

A Shallow Survey of Alternative Languages on the JVM

604
-1

Published on

TBA

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
604
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

A Shallow Survey of Alternative Languages on the JVM

  1. 1. A Shallow Survey of Alternative Languages on the JVM Charles Anderson March 2013
  2. 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. 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. 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. 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. 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● Theres a reason Twitter moved a lot of their system to the JVM
  7. 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. 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. 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. 10. Java or Groovy?class Book { private String title; Book (String theTitle) { title = theTitle; } String getTitle() { return title }}
  11. 11. Stupid Pet Tricksprintln ‘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. 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. 13. Little Sample of Mirahdef printN(str:String, n:int) n.times do puts str endend
  14. 14. New Languages: Scala● Lets 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. 15. Samples of Scalaclass 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. 16. Other New Languages● Clojure - LISP, functional● Koitlin - compiles to Java or JavaScript (from JetBrains/IntelliJ)● Ceylon from RedHat
  17. 17. Conclusion● You dont 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×