Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»

Viktor Gamov
September 23, 2013

JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»

There is a perception in the Java community that JavaScript is a second-league interpreted language with the main purpose of making Web pages a little prettier. But JavaScript is a powerful, flexible, dynamically typed language. And today language has been experiencing its a revival driven by the interest in HTML5. Nashorn is a modern JavaScript engine available on JVM, and it’s already included with JDK8 builds. This presentation is about building polyglot application with Java and JavaScript.

Viktor Gamov

September 23, 2013
Tweet

More Decks by Viktor Gamov

Other Decks in Programming

Transcript

  1. www.faratasystems.com // follow me : twitter.com/gamussa
    Java and JavaScripT—
    Shaken, Not Stirred
    Viktor Gamov
    Senior Software ENGINEER, Farata Systems
    Tuesday, September 24, 13

    View full-size slide

  2. Why you’re here
    ★JavaScript enthusiast
    ★you're interested in JDK8 features
    ★You're fan of James Bond series
    ★you're one of my friends and I asked
    you to come...
    Tuesday, September 24, 13

    View full-size slide

  3. Who is talking?
    ★Software engineer and consultant
    ★co-author and JUG co-lead
    ★professional Russian
    Tuesday, September 24, 13

    View full-size slide

  4. Tuesday, September 24, 13

    View full-size slide

  5. Who is talking?
    ★Software engineer and consultant
    ★co-author and JUG co-lead
    ★professional Russian
    ★Guy between you and beer
    Tuesday, September 24, 13

    View full-size slide

  6. Tuesday, September 24, 13

    View full-size slide

  7. Brace yourself,
    winter is coming
    Tuesday, September 24, 13

    View full-size slide

  8. Tuesday, September 24, 13

    View full-size slide

  9. http://enterprisewebbook.com
    Coming to the stores
    Winter of 2014
    Tuesday, September 24, 13

    View full-size slide

  10. Draft available for free
    http://enterprisewebbook.com
    Tuesday, September 24, 13

    View full-size slide

  11. Polyglot?
    Tuesday, September 24, 13

    View full-size slide

  12. Everybody knows how to javascript
    Tuesday, September 24, 13

    View full-size slide

  13. JavaScript, wat?
    www.destroyallsoftware.com/talks/wat
    Tuesday, September 24, 13

    View full-size slide

  14. MANY good Parts
    Tuesday, September 24, 13

    View full-size slide

  15. SHELL Scripting
    Extend app functionality on
    runtime
    1
    2
    3
    JAVASCRIPT on JVM USE cASES
    WEB-content generation
    4
    provide extension points for
    application
    Tuesday, September 24, 13

    View full-size slide

  16. wait, javascript?
    it’s only for browsers
    Tuesday, September 24, 13

    View full-size slide

  17. JAVAScript is everywhere
    ★v8 and nodejs
    ★Rhino was here for years
    ★Here comes nashorn
    Tuesday, September 24, 13

    View full-size slide

  18. What is Nashorn?
    Tuesday, September 24, 13

    View full-size slide

  19. Ultimate invokedynamic
    consumer
    100% pure Java
    implementation
    100% ECMAScript 5.1
    compliant
    JavaScript Engine for
    JVM
    What is Nashorn?
    100% compiled to
    bytecode,
    no interpreter
    http://www.1001ausmalbilder.de/ausmalbilder/gross/ausmalbild-nashorn-7.jpg
    Tuesday, September 24, 13

    View full-size slide

  20. HOW To USE NASHORN?
    ★ The only API is JSR-223: javax.scripting.*
    ★ Java from JavaScript and vice versa
    ★ Create and manipulate Java/JavaScript objects
    ★ Extend Java classes
    ★ Implement Java interfaces
    Tuesday, September 24, 13

    View full-size slide

  21. Story one:
    Curious
    support engineer
    Tuesday, September 24, 13

    View full-size slide

  22. Story one:
    Curious support engineer
    Tuesday, September 24, 13

    View full-size slide

  23. Story two:
    Family is everything
    Tuesday, September 24, 13

    View full-size slide

  24. Story two:
    Family is everything
    Tuesday, September 24, 13

    View full-size slide

  25. Story Three:
    NASHORN for Browser
    Tuesday, September 24, 13

    View full-size slide

  26. Restrictions
    ★ There ARE No browser APIs:
    ★ HTML5 canvas
    ★ HTML5 audio
    ★ WebWorkers
    ★ WebSockets
    ★ WebGL
    Tuesday, September 24, 13

    View full-size slide

  27. Q&
    A
    Tuesday, September 24, 13

    View full-size slide

  28. THANKS
    FOR YOUR ATTENTION
    www.faratasystems.com // follow me : twitter.com/gamussa
    Tuesday, September 24, 13

    View full-size slide