SlideShare una empresa de Scribd logo
1 de 46
BP203 Limitless Languages In The
                    IBM Social Stack
                    Mark Myers | London Developer Coop




© 2013 IBM Corporation
Agenda

Overview

The JVM

Programming paradigms

JVM Alternative Languages

Scala

Existing Code

Working With Domino

  © 2013 IBM Corporation
This presentation skims over the hard work and dedication of
 thousands of developers passions, any generalizations or
   sweeping statements are not intended to give offense,
             corrections are gratefully received.

                             But most of all please interrupt!

                           Don't wait till the end of the session




  © 2013 IBM Corporation
Who Am I?

 Mark
    Member of the London Developer Co-op (londc.com)
    Developer from a support background
    12+ years on Domino, 15+ years in IT
    Speaker at 2x Lotuspheres, 3x UKLUGs, 1x ILUG
    Twitter: @stickfight, Skype: Stickfight, Blog: stickfight.co.uk




    © 2013 IBM Corporation
Tools We Used

 IBM® Lotus® Notes® version 8.5.3

 IBM Lotus Domino® version 8.5.3

 Eclipse 3.7 (indigo)

 Scala plug-in 29

 Various other software tools mentioned
  throughout this presentation
 Most code and techniques we talk about should be applicable to other versions of
  Notes/Domino/Windows too




    © 2013 IBM Corporation
Limitless Languages?


                                Limitless Languages
                                          =
                            Alternative JVM Languages



                      Alternative JVM Languages
                                   =
              Any Language that Compiles to Java ByteCode




   © 2013 IBM Corporation
Why this Session?

 Existing and Traditional IT cant keep up with the speed of green field and start-up
 development

 You need little or no Investment to get started and you don’t have to throw your
 existing Java stuff away

 Its not all up to IBM to keep us up to date.                 Nearly all of you are
                                                              already using an
 Never get left behind again
                                                              IBM alternative JVM
 Its simple and helps your CV                                 Language (sort of)

 Its Cool




    © 2013 IBM Corporation
The JVM

The JVM (Java Virtual Machine) runs Java ByteCode

It’s Increased in reliability and performance since 1996

All variations of the JVM guarantees binary compatibility

Java ByteCode does NOT have to have been generated from Java, any Language
that compiles down to ByteCode can run on the JVM


                            We will take a look at the Pack Leaders

                                    After some boring stuff




   © 2013 IBM Corporation
Dynamic Vs Static typed: Dynamic
 In a dynamically typed language, every variable name is (unless it is null) bound
 only to an object.

 Names are bound to objects at execution time by means of assignment
 statements, and it is possible to bind a name to objects of different types during
 the execution of the program.

                                           This does not cause an error,
                                           unless you for get which type
  LotusNotes = 8.5.4                       the variable currently is
  LotusNotes = “Awesome”




    © 2013 IBM Corporation
Dynamic Vs Static typed: Static

 In a statically typed language, every variable name is bound both to a type (at
 compile time) and to an object.

 Once a variable name has been bound to a type (that is, declared) it can be bound
 (via an assignment statement) only to objects of that type; it cannot ever be bound
 to an object of a different type. An attempt to bind the name to an object of the
 wrong type will raise a type exception.




   © 2013 IBM Corporation
Functional Programming                          A method of
                                                 coding like
                                                 Object Oriented
                                                 Programming


“functional programming is a programming paradigm that treats computations as the
evaluation of mathematical functions and avoids state and mutable data.”
                                                                         -Wikipedia

                         Think of the states         An object which
                         a document goes             can be modified
                         through                     after it is
                                                     created




     © 2013 IBM Corporation
Functional Programming

Why?
 Grants us greater modularity

 Means code reuse and maintenance is easier

 Immutable objects allows data to be accessed concurrently from multiple threads
 without locking




   © 2013 IBM Corporation
JVM Alternative Languages
 An agile and dynamic language

 A Core of Java with lots of features inspired by languages like Python, Ruby and
 Smalltalk

 Very small-zero learning curve

 provides the ability to statically type check and statically compile your code ( good
 for speed)

 Seamlessly integrates with all existing Java classes and libraries i.e. unlike a lot of
 other Alternative JVM languages you can include Java code in the same file as
 Groovy

 One of Groovy's top companions is Grails, a high-productivity web development
 environment inspired by Ruby on Rails. not much use for domino designers but fab
 if you are having to build your own UI (used by sky)



   © 2013 IBM Corporation
JVM Alternative Languages




 A general-purpose dynamic programming language

 Is a dialect of Lisp

 Also runs on Microsoft's Common Language Runtime and JavaScript engines.

 Used by Citigroup, Typewire, Tianya (largest forum in china), AltLaw.org (one of
 the first production websites to use it)




    © 2013 IBM Corporation
JVM Alternative Languages




 JRuby is an implementation of the Ruby programming language

 JRuby is held to be faster than Ruby for most implementations (once loading the
 JVM is taken into consideration)

 Jruby is called from Java using either the JSR 223 Scripting for Java 6 or the
 Apache Bean Scripting framework

 LinkedIn uses JRuby for its front end




   © 2013 IBM Corporation
JVM Alternative Languages




 Jython the successor of JPython is an implementation of Python

 Supports nearly all of the Core Python standard library modules and all Java Libs

 Jython programs cannot currently use CPython extension modules written in C
 (although this is supposedly coming)

 Wsadmin (webSphere Server command shell) and Bea WebLogic use Jython as
 their scripting language




   © 2013 IBM Corporation
JVM Alternative Languages




                 Kotlin




 Rhino




                            This is the Actual Logo

   © 2013 IBM Corporation
Scala




 Stands for “scalable language.” named for its ability to grow with user needs

 Designed by Martin Odersky, creator of Pizza (the forerunner of Java generics),
 author of GJ compiler



"... if someone had shown me the Programming in Scala book ... back in 2003, I'd
probably have never created Groovy."
                                      - James Strachan, July 2009




   © 2013 IBM Corporation
Scala



Under active development at Ecole Polytechnique Fédérale
de Lausanne (EPFL) and in the open source community,
also nicely funded by none corporations.


 Programming in Scala second edition by Martin Odersky,
 Lex Spoon and Bill Venners

 http://www.artima.com/shop/programming_in_scala_2ed




   © 2013 IBM Corporation
Who Uses Scala?

                LinkedIn                        Siemens

                Twitter                         Électricité de France (EDF)

                FourSquare                      The Guardian

                Sony                            Xerox



       IBM knows about it too, see Adrian Spender excellent
       presentation at
       http://www.slideshare.net/aspender/scala-introduction-6963846

       And from IBM them selves
       http://www.ibm.com/developerworks/training/kp/j-kp-altlang/index.html



  © 2013 IBM Corporation
Why?: Shorter / Less Boiler
 // this is Java
 class MyClass {
       private int index;
       private String name;

        public MyClass(int index, String name) {
        this.index = index;
        this.name = name;
        }
 }

 // this is Scala
 class MyClass(index: Int, name: String)

 http://stackoverflow.com/questions/2952732/samples-of-scala-and-java-code-
 where-scala-code-looks-simpler-has-fewer-lines for an extreme example


     © 2013 IBM Corporation
Why?: Type Inference
     Java – Static Type
            Good – Catch type errors BEFORE you run
            BAD – Verbose, bulky



     Scripting Languages
            Good – Short , easy to code
            BAD – You get to catch your errors in test/production



     Scala (with Type Inference)
            Good – Catch Type Errors BEFORE you run
            Good – Short , easy to code




   © 2013 IBM Corporation
Why?: Type Inference
                             You don’t have to assign a type
                              here, it infers this from type of
                               data you try and put in the
                                           variable


                      val cost = new BigInteger("99999999")
                      var stringcost = List("nine", "nine")
                      Stringcost += cost


                                           But Compiler still says no, when
                                             you assign the wrong type




   © 2013 IBM Corporation
Why?: Unified types
 All types are objects. (Int, Boolean,Double etc etc)

 No more primitives ( no more double and Double)

 All Mapped Automatically for integration with Java

 All functions get the nice add-ons like toInt and toFloat for String




   © 2013 IBM Corporation
Why?: Pattern matching




         Not Limited to primitives

         You can even call Class and Functions :-)




   © 2013 IBM Corporation
Why?: Actors


 Concurrency Made simple

 Designed to get over the fundamental problems with Javas shared data and locks
 model

 It is a share-nothing model all communication is doing by messaging

 An actor is a bit like a thread with a mailbox for receiving messages




   © 2013 IBM Corporation
Why?: Actor example




   © 2013 IBM Corporation
Why?: Parallel Processing
                            How do you make this run in parallel?




   © 2013 IBM Corporation
Why?: Parallel Processing




     Now running in parallel

     Calling thread WAITS for completion of computation

     2 CPU Machine = 2 items running in parallel
   © 2013 IBM Corporation
Sanity Warning! : Scalaz
                                       Danger Will
                                        Robinson

 A Plug in Library for Scala

  An implementation of pure functional programming with very high-level
 abstractions represented by symbols

  Awesomely powerful and concise but a steep learning curve unless you are
 familiar with the complexity and are dealing with things like Trading platforms

 http://code.google.com/p/scalaz/




   © 2013 IBM Corporation
Sanity Warning! : Scalaz




           :'-(

   © 2013 IBM Corporation
Cross Language Dependency



                           Existing Code




  © 2013 IBM Corporation
Cross Language Dependency
                           After Inclusion of a new Scala Class




  © 2013 IBM Corporation
Installing


 Scala has plug-ins for Eclipse, IntelliJIDEA and NetBeans ( http://www.scala-
 lang.org/node/91 )

 I use http://scala-ide.org/ for the eclipse plug-in

 Install Eclipse 3.6 (Helios) or Eclipse 3.7 (Indigo) and install as a standard plug-in
 site (http://download.scala-ide.org/releases-29/stable/site )

 Restart and you’re done




   © 2013 IBM Corporation
Nice and Simple in Eclipse




   © 2013 IBM Corporation
Nice and Simple in Eclipse




   © 2013 IBM Corporation
Working in Domino




Copy these 3 files to your ..jvmlibext directory (they are about 9meg in total and
cause a noticeable pause if in the agent)

Restart and you’re done




   © 2013 IBM Corporation
Working in Domino
                            Normal Java
                            Class doing
                            Stuff in Domino




   © 2013 IBM Corporation
Working in Domino
                            Scala Class, containing an Scala Object, calling that Java Class




   © 2013 IBM Corporation
Working in Domino




                            Export Class files to a Jar


   © 2013 IBM Corporation
Working in Domino




Import Jar file into
  normal Agent




    © 2013 IBM Corporation
Working in Domino



Calling the Scala
Object from Within
  a Java Agent




     © 2013 IBM Corporation
Working in Domino




Be Still my beating
      heart!!!




      © 2013 IBM Corporation
Questions?
                         Mark Myers
                         London Developer Coop
                         mark@energywins.co.uk
                         Twitter: @stickfight




© 2013 IBM Corporation
Legal disclaimer
      •   © IBM Corporation 2013. All Rights Reserved.
      •   The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is
          provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not
          be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any
          warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.
      •   References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this
          presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing
          contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.
      •   Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon
          many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can
          be given that an individual user will achieve results similar to those stated here.
      •   Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
      •   Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
      •   Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
      •   Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
      •   UNIX is a registered trademark of The Open Group in the United States and other countries.
      •   Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
      •   All references to [insert fictitious company name] refer to a fictitious company and are used for illustration purposes only.




 45           © 2013 IBM Corporation
THANK YOU!
                         Mark Myers
                         London Developer Coop
                         mark@energywins.co.uk
                         Twitter: @stickfight




© 2013 IBM Corporation

Más contenido relacionado

La actualidad más candente

Odessa .NET User Group - 10.11.2011 - Applied Code Generation
Odessa .NET User Group - 10.11.2011 - Applied Code Generation Odessa .NET User Group - 10.11.2011 - Applied Code Generation
Odessa .NET User Group - 10.11.2011 - Applied Code Generation
Dmytro Mindra
 

La actualidad más candente (19)

Bn1005 demo ppt core java
Bn1005 demo ppt core javaBn1005 demo ppt core java
Bn1005 demo ppt core java
 
HTML for beginners
HTML for beginnersHTML for beginners
HTML for beginners
 
Java seminar
Java seminarJava seminar
Java seminar
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java training in bangalore
Java training in bangaloreJava training in bangalore
Java training in bangalore
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Odessa .NET User Group - 10.11.2011 - Applied Code Generation
Odessa .NET User Group - 10.11.2011 - Applied Code Generation Odessa .NET User Group - 10.11.2011 - Applied Code Generation
Odessa .NET User Group - 10.11.2011 - Applied Code Generation
 
Cr java concept by vikas jagtap
Cr java  concept by vikas jagtapCr java  concept by vikas jagtap
Cr java concept by vikas jagtap
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.net
 
Ruby vs Java: Comparing Two Popular Programming Languages For Developing Ente...
Ruby vs Java: Comparing Two Popular Programming Languages For Developing Ente...Ruby vs Java: Comparing Two Popular Programming Languages For Developing Ente...
Ruby vs Java: Comparing Two Popular Programming Languages For Developing Ente...
 
02 java programming basic
02  java programming basic02  java programming basic
02 java programming basic
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
Java vs python
Java vs pythonJava vs python
Java vs python
 
Java presentation
Java presentationJava presentation
Java presentation
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
 
core java
core javacore java
core java
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
Core Java
Core JavaCore Java
Core Java
 

Destacado (6)

How to build a computer
How to build a computerHow to build a computer
How to build a computer
 
Show104 buried treasure
Show104 buried treasureShow104 buried treasure
Show104 buried treasure
 
Hassan 2
Hassan 2Hassan 2
Hassan 2
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino Developers
 
SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical Java
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
 

Similar a BP203 limitless languages

J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01
Jay Palit
 

Similar a BP203 limitless languages (20)

JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Bci for Beginners
Bci for BeginnersBci for Beginners
Bci for Beginners
 
java concepts
java conceptsjava concepts
java concepts
 
Programming in java ppt
Programming in java  pptProgramming in java  ppt
Programming in java ppt
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
1.INTRODUCTION TO JAVA_2022 MB.ppt      .1.INTRODUCTION TO JAVA_2022 MB.ppt      .
1.INTRODUCTION TO JAVA_2022 MB.ppt .
 
J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Java Intro
Java IntroJava Intro
Java Intro
 
Java Programming (M&M)
Java Programming (M&M)Java Programming (M&M)
Java Programming (M&M)
 
Java training in chennai, Java course in chennai
Java training in chennai, Java course in chennaiJava training in chennai, Java course in chennai
Java training in chennai, Java course in chennai
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDF
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Java
JavaJava
Java
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 

Más de Mark Myers

Vertical vs Horizontal Scaling
Vertical vs Horizontal Scaling Vertical vs Horizontal Scaling
Vertical vs Horizontal Scaling
Mark Myers
 
Blug2013 frameworks
Blug2013 frameworksBlug2013 frameworks
Blug2013 frameworks
Mark Myers
 

Más de Mark Myers (9)

Engage 2017 - Choose your own adventure
Engage 2017 - Choose your own adventureEngage 2017 - Choose your own adventure
Engage 2017 - Choose your own adventure
 
LDC Via building a new app
LDC Via  building a new appLDC Via  building a new app
LDC Via building a new app
 
Saleforce For Domino Dogs
Saleforce For Domino DogsSaleforce For Domino Dogs
Saleforce For Domino Dogs
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Uklug 2014 connections dev faq
Uklug 2014  connections dev faqUklug 2014  connections dev faq
Uklug 2014 connections dev faq
 
Vertical vs Horizontal Scaling
Vertical vs Horizontal Scaling Vertical vs Horizontal Scaling
Vertical vs Horizontal Scaling
 
The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)
 
Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want
 
Blug2013 frameworks
Blug2013 frameworksBlug2013 frameworks
Blug2013 frameworks
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

BP203 limitless languages

  • 1. BP203 Limitless Languages In The IBM Social Stack Mark Myers | London Developer Coop © 2013 IBM Corporation
  • 2. Agenda Overview The JVM Programming paradigms JVM Alternative Languages Scala Existing Code Working With Domino © 2013 IBM Corporation
  • 3. This presentation skims over the hard work and dedication of thousands of developers passions, any generalizations or sweeping statements are not intended to give offense, corrections are gratefully received. But most of all please interrupt! Don't wait till the end of the session © 2013 IBM Corporation
  • 4. Who Am I?  Mark Member of the London Developer Co-op (londc.com) Developer from a support background 12+ years on Domino, 15+ years in IT Speaker at 2x Lotuspheres, 3x UKLUGs, 1x ILUG Twitter: @stickfight, Skype: Stickfight, Blog: stickfight.co.uk © 2013 IBM Corporation
  • 5. Tools We Used  IBM® Lotus® Notes® version 8.5.3  IBM Lotus Domino® version 8.5.3  Eclipse 3.7 (indigo)  Scala plug-in 29  Various other software tools mentioned throughout this presentation  Most code and techniques we talk about should be applicable to other versions of Notes/Domino/Windows too © 2013 IBM Corporation
  • 6. Limitless Languages? Limitless Languages = Alternative JVM Languages Alternative JVM Languages = Any Language that Compiles to Java ByteCode © 2013 IBM Corporation
  • 7. Why this Session? Existing and Traditional IT cant keep up with the speed of green field and start-up development You need little or no Investment to get started and you don’t have to throw your existing Java stuff away Its not all up to IBM to keep us up to date. Nearly all of you are already using an Never get left behind again IBM alternative JVM Its simple and helps your CV Language (sort of) Its Cool © 2013 IBM Corporation
  • 8. The JVM The JVM (Java Virtual Machine) runs Java ByteCode It’s Increased in reliability and performance since 1996 All variations of the JVM guarantees binary compatibility Java ByteCode does NOT have to have been generated from Java, any Language that compiles down to ByteCode can run on the JVM We will take a look at the Pack Leaders After some boring stuff © 2013 IBM Corporation
  • 9. Dynamic Vs Static typed: Dynamic In a dynamically typed language, every variable name is (unless it is null) bound only to an object. Names are bound to objects at execution time by means of assignment statements, and it is possible to bind a name to objects of different types during the execution of the program. This does not cause an error, unless you for get which type LotusNotes = 8.5.4 the variable currently is LotusNotes = “Awesome” © 2013 IBM Corporation
  • 10. Dynamic Vs Static typed: Static In a statically typed language, every variable name is bound both to a type (at compile time) and to an object. Once a variable name has been bound to a type (that is, declared) it can be bound (via an assignment statement) only to objects of that type; it cannot ever be bound to an object of a different type. An attempt to bind the name to an object of the wrong type will raise a type exception. © 2013 IBM Corporation
  • 11. Functional Programming A method of coding like Object Oriented Programming “functional programming is a programming paradigm that treats computations as the evaluation of mathematical functions and avoids state and mutable data.” -Wikipedia Think of the states An object which a document goes can be modified through after it is created © 2013 IBM Corporation
  • 12. Functional Programming Why? Grants us greater modularity Means code reuse and maintenance is easier Immutable objects allows data to be accessed concurrently from multiple threads without locking © 2013 IBM Corporation
  • 13. JVM Alternative Languages An agile and dynamic language A Core of Java with lots of features inspired by languages like Python, Ruby and Smalltalk Very small-zero learning curve provides the ability to statically type check and statically compile your code ( good for speed) Seamlessly integrates with all existing Java classes and libraries i.e. unlike a lot of other Alternative JVM languages you can include Java code in the same file as Groovy One of Groovy's top companions is Grails, a high-productivity web development environment inspired by Ruby on Rails. not much use for domino designers but fab if you are having to build your own UI (used by sky) © 2013 IBM Corporation
  • 14. JVM Alternative Languages A general-purpose dynamic programming language Is a dialect of Lisp Also runs on Microsoft's Common Language Runtime and JavaScript engines. Used by Citigroup, Typewire, Tianya (largest forum in china), AltLaw.org (one of the first production websites to use it) © 2013 IBM Corporation
  • 15. JVM Alternative Languages JRuby is an implementation of the Ruby programming language JRuby is held to be faster than Ruby for most implementations (once loading the JVM is taken into consideration) Jruby is called from Java using either the JSR 223 Scripting for Java 6 or the Apache Bean Scripting framework LinkedIn uses JRuby for its front end © 2013 IBM Corporation
  • 16. JVM Alternative Languages Jython the successor of JPython is an implementation of Python Supports nearly all of the Core Python standard library modules and all Java Libs Jython programs cannot currently use CPython extension modules written in C (although this is supposedly coming) Wsadmin (webSphere Server command shell) and Bea WebLogic use Jython as their scripting language © 2013 IBM Corporation
  • 17. JVM Alternative Languages Kotlin Rhino This is the Actual Logo © 2013 IBM Corporation
  • 18. Scala Stands for “scalable language.” named for its ability to grow with user needs Designed by Martin Odersky, creator of Pizza (the forerunner of Java generics), author of GJ compiler "... if someone had shown me the Programming in Scala book ... back in 2003, I'd probably have never created Groovy." - James Strachan, July 2009 © 2013 IBM Corporation
  • 19. Scala Under active development at Ecole Polytechnique Fédérale de Lausanne (EPFL) and in the open source community, also nicely funded by none corporations. Programming in Scala second edition by Martin Odersky, Lex Spoon and Bill Venners http://www.artima.com/shop/programming_in_scala_2ed © 2013 IBM Corporation
  • 20. Who Uses Scala? LinkedIn Siemens Twitter Électricité de France (EDF) FourSquare The Guardian Sony Xerox IBM knows about it too, see Adrian Spender excellent presentation at http://www.slideshare.net/aspender/scala-introduction-6963846 And from IBM them selves http://www.ibm.com/developerworks/training/kp/j-kp-altlang/index.html © 2013 IBM Corporation
  • 21. Why?: Shorter / Less Boiler // this is Java class MyClass { private int index; private String name; public MyClass(int index, String name) { this.index = index; this.name = name; } } // this is Scala class MyClass(index: Int, name: String) http://stackoverflow.com/questions/2952732/samples-of-scala-and-java-code- where-scala-code-looks-simpler-has-fewer-lines for an extreme example © 2013 IBM Corporation
  • 22. Why?: Type Inference Java – Static Type Good – Catch type errors BEFORE you run BAD – Verbose, bulky Scripting Languages Good – Short , easy to code BAD – You get to catch your errors in test/production Scala (with Type Inference) Good – Catch Type Errors BEFORE you run Good – Short , easy to code © 2013 IBM Corporation
  • 23. Why?: Type Inference You don’t have to assign a type here, it infers this from type of data you try and put in the variable val cost = new BigInteger("99999999") var stringcost = List("nine", "nine") Stringcost += cost But Compiler still says no, when you assign the wrong type © 2013 IBM Corporation
  • 24. Why?: Unified types All types are objects. (Int, Boolean,Double etc etc) No more primitives ( no more double and Double) All Mapped Automatically for integration with Java All functions get the nice add-ons like toInt and toFloat for String © 2013 IBM Corporation
  • 25. Why?: Pattern matching Not Limited to primitives You can even call Class and Functions :-) © 2013 IBM Corporation
  • 26. Why?: Actors Concurrency Made simple Designed to get over the fundamental problems with Javas shared data and locks model It is a share-nothing model all communication is doing by messaging An actor is a bit like a thread with a mailbox for receiving messages © 2013 IBM Corporation
  • 27. Why?: Actor example © 2013 IBM Corporation
  • 28. Why?: Parallel Processing How do you make this run in parallel? © 2013 IBM Corporation
  • 29. Why?: Parallel Processing Now running in parallel Calling thread WAITS for completion of computation 2 CPU Machine = 2 items running in parallel © 2013 IBM Corporation
  • 30. Sanity Warning! : Scalaz Danger Will Robinson A Plug in Library for Scala An implementation of pure functional programming with very high-level abstractions represented by symbols Awesomely powerful and concise but a steep learning curve unless you are familiar with the complexity and are dealing with things like Trading platforms http://code.google.com/p/scalaz/ © 2013 IBM Corporation
  • 31. Sanity Warning! : Scalaz :'-( © 2013 IBM Corporation
  • 32. Cross Language Dependency Existing Code © 2013 IBM Corporation
  • 33. Cross Language Dependency After Inclusion of a new Scala Class © 2013 IBM Corporation
  • 34. Installing Scala has plug-ins for Eclipse, IntelliJIDEA and NetBeans ( http://www.scala- lang.org/node/91 ) I use http://scala-ide.org/ for the eclipse plug-in Install Eclipse 3.6 (Helios) or Eclipse 3.7 (Indigo) and install as a standard plug-in site (http://download.scala-ide.org/releases-29/stable/site ) Restart and you’re done © 2013 IBM Corporation
  • 35. Nice and Simple in Eclipse © 2013 IBM Corporation
  • 36. Nice and Simple in Eclipse © 2013 IBM Corporation
  • 37. Working in Domino Copy these 3 files to your ..jvmlibext directory (they are about 9meg in total and cause a noticeable pause if in the agent) Restart and you’re done © 2013 IBM Corporation
  • 38. Working in Domino Normal Java Class doing Stuff in Domino © 2013 IBM Corporation
  • 39. Working in Domino Scala Class, containing an Scala Object, calling that Java Class © 2013 IBM Corporation
  • 40. Working in Domino Export Class files to a Jar © 2013 IBM Corporation
  • 41. Working in Domino Import Jar file into normal Agent © 2013 IBM Corporation
  • 42. Working in Domino Calling the Scala Object from Within a Java Agent © 2013 IBM Corporation
  • 43. Working in Domino Be Still my beating heart!!! © 2013 IBM Corporation
  • 44. Questions? Mark Myers London Developer Coop mark@energywins.co.uk Twitter: @stickfight © 2013 IBM Corporation
  • 45. Legal disclaimer • © IBM Corporation 2013. All Rights Reserved. • The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. • References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results. • Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here. • Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. • Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. • Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both. • Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. • UNIX is a registered trademark of The Open Group in the United States and other countries. • Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others. • All references to [insert fictitious company name] refer to a fictitious company and are used for illustration purposes only. 45 © 2013 IBM Corporation
  • 46. THANK YOU! Mark Myers London Developer Coop mark@energywins.co.uk Twitter: @stickfight © 2013 IBM Corporation