SlideShare ist ein Scribd-Unternehmen logo
1 von 98
Downloaden Sie, um offline zu lesen
Writing Your Own JSR-Compliant, Domain-
Specific Scripting Language

David Smith, Software Engineer
John Colosi, Software Engineer
TS-5693
Prove the power of Domain Specific
Languages to simplify work, communicate
ideas, and manipulate space-time




                             2008 JavaOneSM Conference | java.sun.com/javaone |   2
Demonstrate by example some techniques for
using Java™ Specification Request (JSR)-
223 to build your own simple, portable
Domain Specific Language




                            2008 JavaOneSM Conference | java.sun.com/javaone |   3
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone |   4
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone |   5
What is JSR-223?

JSR-223 defines certain contracts between the Java Virtual
  Machine (JVM™) and a scripting language
  It covers:
   • Motivations behind its creation
   • How the JVM tool will discover available scripting languages at
     runtime
   • The classes and interfaces that define relationships between a
     script engine and the JVM tool
  Scripting support was introduced with Java 6 platform
  At scripting.dev.java.net you can find a list of JSR-
  conforming scripting-language implementations



                                               2008 JavaOneSM Conference | java.sun.com/javaone |   6
What is a scripting language?

 A language whose programs control applications rather
 than exist as applications on their own
 Scripts ordinarily contain sequences of commands
 intended for the target application
 Usually interpreted
 Definition has become muddled




                                     2008 JavaOneSM Conference | java.sun.com/javaone |   7
What is a DSL?

 Full of terms and jargon particular to the domain
 Not necessarily a computer language, even though that’s
 how engineers might think about them
 Often impenetrable to outsiders
 The same way design patterns can be referred to by name
 and connote lots of information to those knowledgeable




                                    2008 JavaOneSM Conference | java.sun.com/javaone |   8
Shared context

 When there are things we all understand, we can factor
 them out of the communication
 DSLs assume a shared context between language user
 and language interpreter
 The “domain” in DSL signifies that context




                                     2008 JavaOneSM Conference | java.sun.com/javaone |   9
What is Domain Specific Language?

 Spoken languages are imperfect
  • Rich
  • Not concise




                                  2008 JavaOneSM Conference | java.sun.com/javaone | 10
What is Domain Specific Language?

 “The way an object in front
 of a light source appears
 darker than it really is”
  • Silhouette




                               2008 JavaOneSM Conference | java.sun.com/javaone | 11
What is Domain Specific Language?

 “The strange effect of perspective when a large viewing
 angle is forced into a smaller viewing angle”
  • Fisheye




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 12
Diamonds in the Rough

 When my wife says:
 • “What happened to the last batter?”




                                2008 JavaOneSM Conference | java.sun.com/javaone | 13
Diamonds in the Rough

 There were runners at First…




                                2008 JavaOneSM Conference | java.sun.com/javaone | 14
Diamonds in the Rough

 … and Second base…




                        2008 JavaOneSM Conference | java.sun.com/javaone | 15
Diamonds in the Rough

 … with 1 out…




                        2008 JavaOneSM Conference | java.sun.com/javaone | 16
Diamonds in the Rough

 … when the batter…




                        2008 JavaOneSM Conference | java.sun.com/javaone | 17
Diamonds in the Rough

 … hit a pop fly in the infield…




                                   2008 JavaOneSM Conference | java.sun.com/javaone | 18
Diamonds in the Rough

 … The defense could just drop the ball…




                               2008 JavaOneSM Conference | java.sun.com/javaone | 19
Diamonds in the Rough

 … and turn a double play…




                             2008 JavaOneSM Conference | java.sun.com/javaone | 20
Diamonds in the Rough

 … to avoid this, the batter was called out…




                                 2008 JavaOneSM Conference | java.sun.com/javaone | 21
Diamonds in the Rough

 … and the runners…




                        2008 JavaOneSM Conference | java.sun.com/javaone | 22
Diamonds in the Rough

 … hold their positions




                          2008 JavaOneSM Conference | java.sun.com/javaone | 23
Diamonds in the Rough

 That’s a mouthful




                        2008 JavaOneSM Conference | java.sun.com/javaone | 24
Diamonds in the Rough

 If David asked the same question…




                               2008 JavaOneSM Conference | java.sun.com/javaone | 25
Diamonds in the Rough

 Infield Fly Rule




                        2008 JavaOneSM Conference | java.sun.com/javaone | 26
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 27
Relationship of computer languages

                                        Rich languages (e.g., Java)




   Scripting languages (e.g., Groovy)                                 Domain-specific languages




                                                                      2008 JavaOneSM Conference | java.sun.com/javaone | 28
DSLs vs. rich computer languages

 Rich languages start by not knowing what you’re talking
 about
  • The Java platform doesn’t know what a bank account is
 Rich languages must allow for all possibilities of
 application
  • You can use C to navigate a space shuttle, C++ to run a backend
   financial system, and a Java platform to make Duke show up in an
   applet




                                            2008 JavaOneSM Conference | java.sun.com/javaone | 29
Duke




       2008 JavaOneSM Conference | java.sun.com/javaone | 30
Why use a DSL?

 Deep Blue is a
 chess playing
 computer




                  2008 JavaOneSM Conference | java.sun.com/javaone | 31
Why use a DSL?

 In 1997, it won a
 match…
 …against Gary
 Kasparov, reigning
 world champion




                      2008 JavaOneSM Conference | java.sun.com/javaone | 32
Why use a DSL?

 But Deep Blue
 doesn’t know the
 rules of chess…
 It just has a good
 memory




                      2008 JavaOneSM Conference | java.sun.com/javaone | 33
Why use a DSL?

 Deep Blue needs
 something better
 than the SQL, the
 “Standard” Query
 Language
 CQL is the “Chess”
 Query Language




                      2008 JavaOneSM Conference | java.sun.com/javaone | 34
What could this mean?

   :relation (:missingpiececount A 1)




                          2008 JavaOneSM Conference | java.sun.com/javaone | 35
CQL
Syntax             CQL syntax            Keywords   Keywords
 • K white king      k black king         • :mate      :pattern
 • N white knight    n black knight       • :check     :relation
 • B white bishop    b black bishop       • :wtm      (white to move)
 • P white pawn      p black pawn         • :terminal (final position)
 • R white rook      r black rook
 • Q white queen     q black queen
 • A any white piece a any black piece
 • . empty square    U any piece




                                              2008 JavaOneSM Conference | java.sun.com/javaone | 36
:relation (:missingpiececount A 1)

Find games where White sacrificed a piece to improve his
position




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 37
CQL


CQL was developed by Gady Costeff and Lewis Stiller
It is Copyright (c) 2003-2004 and is free




                                   2008 JavaOneSM Conference | java.sun.com/javaone | 38
Other DSL examples

 Wiki markup language
 SQL
  • Imagine all the complexity behind this simple command
    • SELECT /*+ PARALLEL(emp,4) */ COUNT(*) FROM emp ;
 SPSS – stat *example*
 Solaris™ Flash technology actionscript – this is pretty rich
 though
 AI scripts




                                            2008 JavaOneSM Conference | java.sun.com/javaone | 39
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 40
Beginning the implementations

 JSR-223 defines six classes and six interfaces
 All can be found in the javax.script package
 These fall into the categories of:
  • the scripting engine for a language
  • the context in which a script is running




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 41
JSR-223 API: relations between manager
and factories

                                   ScriptEngine
   ScriptEngine
                                      Factory
     Manager                       (language x)

                                   ScriptEngine
                                      Factory
                                   (language y)
    Service
      locator                      ScriptEngine
                                      Factory
                                   (language z)
language    language   language
   x           y          z


                                  2008 JavaOneSM Conference | java.sun.com/javaone | 42
JSR-223 API: the ScriptEngineManager

 The ScriptEngineManager
  • Auto-discovers scripting lanugaues
  • Determines which engine factory to give you based on language
   name, MIME-type, or extension that you supply
 It’s a factory of factories




                                            2008 JavaOneSM Conference | java.sun.com/javaone | 43
JSR-223 API: relations between factories
and engines

                  ScriptEngine
  ScriptEngine                       ScriptEngine
                     Factory
   Manager                           (language x)
                  (language x)




                 ScriptEngine
                 (language x)
                                    scripts
                                 (language x)




                                  2008 JavaOneSM Conference | java.sun.com/javaone | 44
JSR-223 API: the script engine and its
factory
 ScriptEngineFactory
  • Produces instances of your engine
  • Maps MIMEs, extensions, and language names to itself
  • Provides syntax for method calls and output statements
  • Provides mechanism for building a script from statements
 ScriptEngine
  • Interprets and runs (“evaluates”) your scripts
  • Requires you to implement overloaded eval() method for script
    interpretation




                                             2008 JavaOneSM Conference | java.sun.com/javaone | 45
Code example: hello world

// get Groovy engine from the SEM
ScriptEngineManager sem = new
  ScriptEngineManager();
ScriptEngine groovyEng =
  sem.getEngineByName( "groovy" );
// run a script
groovyEng.eval( "println 'hello world'" );




                             2008 JavaOneSM Conference | java.sun.com/javaone | 46
JSR-223 API: closer look at ScriptEngine
class
public Object eval ( ... ) throws
  ScriptException

 The ( ... ) can be
  • String
  • Reader
  • String, ScriptContext
  • Reader, ScriptContext
  • String, Bindings
  • Reader, Bindings




                             2008 JavaOneSM Conference | java.sun.com/javaone | 47
JSR-223 API: Interactions between a Java
platform application and an engine

   Java application
                                               ScriptEngine
                                                  Manager
                      ScriptContext
    {                                          ScriptEngine
         …                                       Factory
                        Bindings
        Java code
        …
    }
                        Bindings               ScriptEngine




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 48
JSR-223 API: the script’s runtime context

 Bindings
  • Holds name-value pairs
  • Objects can be bound into, retrieved from, and removed from the
    Bindings by both the script and the Java platform caller to the script
 ScriptContext
  • Context in which scripts run
  • Provides access to scoped Bindings
  • Provides reader and two writers (standard, error) for script input
    and output




                                                2008 JavaOneSM Conference | java.sun.com/javaone | 49
JSR-223 API: Bindings hierarchy

 Bindings have scopes
  • Global scope – can be set in the ScriptEngineManager or the
   ScriptEngine before script evaluation
 • Engine scope – can be set in the ScriptEngine before script
   evaluation
 • “Local” scope – can be passed in at script-evaluation time and
   used for that evaluation only
 The ScriptEngine will look for a specific binding (property
 in a Bindings) by going from local to engine to global
 scope




                                             2008 JavaOneSM Conference | java.sun.com/javaone | 50
Code example: round trip with “local”
bindings
 // get the Groovy engine from the SEM
 ScriptEngineManager sem = new ScriptEngineManager();
 ScriptEngine groovyEng = sem.getEngineByName(
 "groovy" );

 // create some bindings for our script run
 Bindings runBindings = groovyEng.createBindings();
 runBindings.put( "greeting", "hello from script" );

 // run the script and supply those bindings
 groovyEng.eval( "println greeting", runBindings );




                                  2008 JavaOneSM Conference | java.sun.com/javaone | 51
JSR-223 API: helper classes

 SimpleBindings
 SimpleScriptContex
 AbstractScriptEngine




                          2008 JavaOneSM Conference | java.sun.com/javaone | 52
JSR-223 API: optional engine facilities

 Compilable
 Invocable




                            2008 JavaOneSM Conference | java.sun.com/javaone | 53
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 54
Writing your own language: how and
where to start?
 Sometimes the biggest hurdle is getting started
 JSR-223 is a friendly, welcoming specification
 DSLs are only and exactly as difficult to write as you
 decide they will be




                                        2008 JavaOneSM Conference | java.sun.com/javaone | 55
Start at the end

 What should the eventual script look like?
 • Syntax
 • Semantics
 What features do you want to support?
 • What are the nouns that will be important?
 • What verbs – what actions?




                                         2008 JavaOneSM Conference | java.sun.com/javaone | 56
An example script

showMap zipcode=22207
setZoomLevel 15
showIcons schools
showIcons libraries
plotRoute mySavedRoute




                         2008 JavaOneSM Conference | java.sun.com/javaone | 57
Begin implementation with
AbstractScriptEngine
 Have createBindings() return a new SimpleBindings
 Consolidate the two remaining eval() methods
  • private Object eval(final Reader reader, final
    Bindings bindings, final ScriptContext context)
    throws ScriptException
 Implement the new eval() method
  • Start with “Hello World”
  • Write a test that calls all of the different public eval() methods




                                                 2008 JavaOneSM Conference | java.sun.com/javaone | 58
Write your ScriptEngineFactory

 None of its methods require any computation!
 Two of its methods deal with your script’s syntax
  • getMethodCallSyntax(…) requires some thought, but not much
  • getProgram(…) requires even less thought
 Write a test to grab the engine from the factory and
 execute a script




                                           2008 JavaOneSM Conference | java.sun.com/javaone | 59
Package it properly

 Use the service-provider convention for auto discovery
  • META-INF
    • /services
       • /javax.script.ScriptEngineFactory
           • com.my.script.MyScriptEngineFactory

 Write a test to get your ScriptEngineFactory via the
 ScriptEngineManager




                                               2008 JavaOneSM Conference | java.sun.com/javaone | 60
Ummm… you’re now JSR-compliant!

 You’re almost done!
 You now have to change your new ScriptEngine’s private
 eval() method to do more than “Hello World”
  • Unless your intention was to have a HelloWorldScriptEngine
  • There’s nothing wrong with that, by the way




                                         2008 JavaOneSM Conference | java.sun.com/javaone | 61
Advanced parsing

 If your language is complex, separate/encapsulate the
 parse and the execute concerns
  • Try ANTLR for parsing
  • Consider implementing Invocable and Compilable if you have a
   compilation step separate from the execution

 However, a complicated language means fewer users




                                            2008 JavaOneSM Conference | java.sun.com/javaone | 62
Extending your interpreter

 Want to get fancy?
 • Support variables
 • Allow output redirection
 • Allow input redirection
 • Provide extensive error messages (ScriptException supports line-
    number support)
  • …what else…?
 What implicit procedures and variables will you expose to
 all scripts?
  • Unique ID generator?
  • Logging?



                                            2008 JavaOneSM Conference | java.sun.com/javaone | 63
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 64
Case studies

 John & David are Java platform programmers
 John’s into video games
 David’s into music
 They understand the basics of the JSR




                                   2008 JavaOneSM Conference | java.sun.com/javaone | 65
David’s MP3 player

filter band=Wolfhounds
shuffle on
repeat on
play




                         2008 JavaOneSM Conference | java.sun.com/javaone | 66
The Gaming Revolution
 The Next Big Thing




                        2008 JavaOneSM Conference | java.sun.com/javaone | 67
The Old School




                 2008 JavaOneSM Conference | java.sun.com/javaone | 68
The New School




                 2008 JavaOneSM Conference | java.sun.com/javaone | 69
The Gaming Revolution

 I want to make a language that asserts the basic principles
 of game play
 I wish I could cheat and write something like this:
  • Jump once
  • If I’m near the top of my jump, then assert that I can jump again
  • If I’m not, then assert that I can’t jump
 Can’t we all just get along
 If I need a test case for my test case, it’s too complicated




                                             2008 JavaOneSM Conference | java.sun.com/javaone | 70
Enter Gameplan:
      The Gameplay Description Language
 Do
  • Simple commands like “JUMP”
  • Assignments like Health=25
 Wait – {}
  • Simple commands like “{Standing}”
  • Assignments like {Height<300}
  • Comparisons like {ShotsInTheAir=0}
  • Sleep like {2000}
 Assert – []
  • Simple commands like “[JUMPING]”
  • Assignments like [Ammo = 100]
  • Comparisons like [Lives > 0]

                                         2008 JavaOneSM Conference | java.sun.com/javaone | 71
Example Gameplan file
# Double jump
jump {nearpeak} jump [height>300]

# Can’t jump when you’re rolling
roll [rolling] {200} jump [height=0]

# Shooting
maxshotsintheair=1 shoot [shotsintheair=1] shoot shoot
  [shotsintheair=1]

# Upgrade
maxshotsintheair=4 shotsintheair=0 shoot
  [shotsintheair=1] shoot shoot [shotsintheair=3]


                                    2008 JavaOneSM Conference | java.sun.com/javaone | 72
Verisign Gameplan Implementation (VGI)

 One object method
 • GamplanScriptEngine.eval(String, context)
 One properties file
 • Gameplan.definition.txt
 One Registration file
 • javax.script.ScriptEngineFactory




                                           2008 JavaOneSM Conference | java.sun.com/javaone | 73
GamplanScriptEngine.eval(String, context)
    public Object eval(String script, ScriptContext context) throws
    ScriptException {

         // Start the Game object

         // Foreach line of input

                  // If it looks like [***]
                           // Assert the condition inside

                  // If it looks like {***}
                           // Wait on the condition inside

                  // Otherwise
                           // Change the state of the Game object

         // Stop the Game object
}



                                                    2008 JavaOneSM Conference | java.sun.com/javaone | 74
Gameplan.definition.txt
script.extensions = .game .gp
script.mimetypes = text/plain application/gameplan
script.name.short = Gameplan
script.name.long = Gameplan - Gameplay Description Language
script.name.list = Gameplan gpln gp GDL
script.version = 1.0

engine.name = Verisign Gameplan Interpreter
engine.class = com.vrsn.script.GameplanScriptEngine
engine.version = 2.3




                                       2008 JavaOneSM Conference | java.sun.com/javaone | 75
javax.script.ScriptEngineFactory
 /META-INF/services/javax.script.ScriptEngineFactory
  • com.vrsn.script.gameplan.GameplanScriptEngineFactory




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 76
VeriSign Gameplan Interpreter




                        2008 JavaOneSM Conference | java.sun.com/javaone | 77
The Gaming Revolution

 Don’t worry, we’ve slowed down the game for
 demonstration purposes. The real version will run almost
 10% faster!




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 78
The Gaming Revolution

 I know what you’re thinking, does this game really
 revolutionize gaming…




                                       2008 JavaOneSM Conference | java.sun.com/javaone | 79
John & David write their DSLs, get traction

 MP3-player users love scripting their players
 Videogame users love scripting their players
 Because they’re so easy to use, others besides intended
 users pick up on them
  • QA for MP3 player want to start using it
  • {…some people besides users…} for videogame wanna use it




                                        2008 JavaOneSM Conference | java.sun.com/javaone | 80
Allow plugins

 Allow for people to add to the language dynamically via
 plugins
 Plugins implement callback for handling script commands

public interface ScriptPlugin {
  handleLine (String scriptLine)
}

 Plugins register their triggering keywords with scripts.
 Interpreter routes triggered commands to plugins


                                        2008 JavaOneSM Conference | java.sun.com/javaone | 81
Registration mechanism

# register ‘assert’ plugin with engine
plugin assert com.verisign.mp3.qa.Assertions

# validate that plugin is working
assert activeSongCount=0




                             2008 JavaOneSM Conference | java.sun.com/javaone | 82
QA script

# validate filter features
filter genre=downtempo
assert activeSongCount=33
assert activeGenre=downtempo
saveFilter myTestFilter
clearFilter
assert activeSongCount=0
loadFilter myTestFilter
assert activeSongCount=33
assert activeGenre=downtempo


                               2008 JavaOneSM Conference | java.sun.com/javaone | 83
Videogame marketing folks

 you can have your Java platform code generate and
 execute such scripts while running
 you can save yourself compilation, build, packaging, and
 deployment cycles by separating the dynamic logic from
 the application proper




                                      2008 JavaOneSM Conference | java.sun.com/javaone | 84
Synergy between music fans and gamers

 What gamer doesn’t want to control the game’s
 soundtrack?
 Gamers want to use their own music
 Gamers want the right music for the right moment




                                     2008 JavaOneSM Conference | java.sun.com/javaone | 85
The beauty of JSR-223 compliance

 Because the scripting languages share common
 interfaces…
 Because the JSR specifies a discovery mechanism…
 Because the calling program doesn’t need to know
 anything about the language…
 The languages become interoperable




                                   2008 JavaOneSM Conference | java.sun.com/javaone | 86
Combination script

{{ some Gameplan stuff }}
[[[ mp3
filter band=Wolfhounds
shuffle on
repeat on
play
]]]
{{ more Gameplan }}




                            2008 JavaOneSM Conference | java.sun.com/javaone | 87
Agenda

 Background on JSR-223, scripting, and DSLs
 Domain Specific Languages in detail
 Walk-through of JSR-223
 Writing your own DSL
 DSL Case Studies
 Jumpstart your development




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 88
Introducing ScriptBlend

 Non-intrusive means of embedding different languages in
 the same script
 Scripts can share variables with one another
 Foreign script snippets can be inserted into flows
 midstream




                                     2008 JavaOneSM Conference | java.sun.com/javaone | 89
ScriptBlend: Midstream insertion

echo “hello”
[[[ groovy
for ( i in 1..5 ) {
... ]]]
echo “hi from native script”
[[[ ...
}
def groovyHi = "hi from groovy";
scriptGlue.publish("groovyHi", groovyHi);
]]]
echo ${groovyHi}

                             2008 JavaOneSM Conference | java.sun.com/javaone | 90
More on ScriptBlend

 Supports nesting of foreign scripts (e.g., JavaScript™
 technology snippet inside a Groovy snippet inside a
 Beanshell snippet)
 Provides a simple way to enable the
 ScriptEngineManager, individual ScriptEngineFactories,
 and individual ScriptEngines to interpret blended scripts
 Possible Eclipse plugin for creating and editing blended
 scripts
 More to follow…?




                                       2008 JavaOneSM Conference | java.sun.com/javaone | 91
Excited to get started scripting?

 We have a starter kit to get you going
 Simplifies an already-friendly API




                                          2008 JavaOneSM Conference | java.sun.com/javaone | 92
Starter Kit

 Implementations of JSR-223 must provide a factory and
 engine, but some common functionality can be assumed
  • VerisignScriptEngineProperties
     • Loads properties from a resource
  • VerisignScriptEngineFactory
     • Loads Engine specified in the properties
  • VerisignScriptEngine
     • Reads input scripts intelligently
     • Funnels all eval methods into one which you implement

 All that’s left is to dream up the language



                                                 2008 JavaOneSM Conference | java.sun.com/javaone | 93
Presentation Map

                            John and David’s
          JSR-223           Simple Framework

                                                                       Gameplan

                                                                         Gameplay
  DSL       Music                                                       Description
                                      VGI                                Language
         Interaction            VeriSign Gameplan
          Language                  Interpreter


                        Advanced
                       Techniques                Gameplan
                                                 Examples



             Where to go from here
                                            2008 JavaOneSM Conference | java.sun.com/javaone | 94
Summary

 Domain Specific Languages provide portable power in a
 simple box that even the business guys can understand


 Build a rocket ship with a one
 page manual that your
 customers can operate




                                    2008 JavaOneSM Conference | java.sun.com/javaone | 95
For More Information

 List
  • Cross-references to other sessions
  • BOFs
  • URLs
  • Related books, etc.




                                         2008 JavaOneSM Conference | java.sun.com/javaone | 96
Image Attributions
 Creative Commons License
  • First Base    Flickr user timailius
  • Second Base   Flickr user billaday
  • 1 out         Flickr user newyork808
  • Batter        Flickr user pingnews
  • Fly ball      Flickr user foreverdigital
  • Dropped ball  Flickr user hobbes8calvin
  • Double play   Flickr user Michael (mx5tx)
  • Umpire        Flickr user Tom Clifton
  • Deep Blue     Flickr user davespilbrow
  • Chess Pieces  Flickr user Shefaet
  • Earth         Flickr user susemueller
  • Silhouette    Flickr user jekkyl
  • Fisheye       Flickr user ValterJacinto
  • Baseball      Flickr user B Tal

 Stock Xchng, Public License
  • Thunderbirds2 Rocketship


                                            2008 JavaOneSM Conference | java.sun.com/javaone | 97
David Smith, Software Engineer
John Colosi, Software Engineer


TS-5693




                                 2008 JavaOneSM Conference | java.sun.com/javaone | 98

Weitere ähnliche Inhalte

Andere mochten auch

Bibliografía primaria y topológica de las ediciones de los libros de Santiago...
Bibliografía primaria y topológica de las ediciones de los libros de Santiago...Bibliografía primaria y topológica de las ediciones de los libros de Santiago...
Bibliografía primaria y topológica de las ediciones de los libros de Santiago...Marta Domínguez-Senra
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
JCR Content Management
JCR Content ManagementJCR Content Management
JCR Content Managementelliando dias
 
Implementing S-Expressions Based Extented Languages in LISP
Implementing S-Expressions Based Extented Languages in LISPImplementing S-Expressions Based Extented Languages in LISP
Implementing S-Expressions Based Extented Languages in LISPelliando dias
 
SharePoint Governance and Lifecycle Management with Project Server 2010
SharePoint Governance and Lifecycle Management with Project Server 2010SharePoint Governance and Lifecycle Management with Project Server 2010
SharePoint Governance and Lifecycle Management with Project Server 2010Alexander Burton
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 

Andere mochten auch (9)

Bibliografía primaria y topológica de las ediciones de los libros de Santiago...
Bibliografía primaria y topológica de las ediciones de los libros de Santiago...Bibliografía primaria y topológica de las ediciones de los libros de Santiago...
Bibliografía primaria y topológica de las ediciones de los libros de Santiago...
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
JCR Content Management
JCR Content ManagementJCR Content Management
JCR Content Management
 
Implementing S-Expressions Based Extented Languages in LISP
Implementing S-Expressions Based Extented Languages in LISPImplementing S-Expressions Based Extented Languages in LISP
Implementing S-Expressions Based Extented Languages in LISP
 
SharePoint Governance and Lifecycle Management with Project Server 2010
SharePoint Governance and Lifecycle Management with Project Server 2010SharePoint Governance and Lifecycle Management with Project Server 2010
SharePoint Governance and Lifecycle Management with Project Server 2010
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 

Ähnlich wie Writing Your Own JSR-Compliant, Domain-Specific Scripting Language

Boldly go where the Java programming language has never gone before
Boldly go where the Java programming language has never gone beforeBoldly go where the Java programming language has never gone before
Boldly go where the Java programming language has never gone beforeelliando dias
 
JRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell YouJRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell Youelliando dias
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...elliando dias
 
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...elliando dias
 
JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005Edoardo Schepis
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?jbandi
 
Virtualizing a Virtual Machine
Virtualizing a Virtual MachineVirtualizing a Virtual Machine
Virtualizing a Virtual Machineelliando dias
 
Javaforum 20110915
Javaforum 20110915Javaforum 20110915
Javaforum 20110915Squeed
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastUzairSaeed18
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications Fabrizio Giudici
 
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...jaxLondonConference
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloudlennartkats
 
Chapter 1. java programming language overview
Chapter 1. java programming language overviewChapter 1. java programming language overview
Chapter 1. java programming language overviewJong Soon Bok
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedSteve Dalton
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 

Ähnlich wie Writing Your Own JSR-Compliant, Domain-Specific Scripting Language (20)

Boldly go where the Java programming language has never gone before
Boldly go where the Java programming language has never gone beforeBoldly go where the Java programming language has never gone before
Boldly go where the Java programming language has never gone before
 
JRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell YouJRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell You
 
Jax keynote
Jax keynoteJax keynote
Jax keynote
 
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...Language-Oriented Programming and Language Workbenches: Building Domain Langu...
Language-Oriented Programming and Language Workbenches: Building Domain Langu...
 
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...
Exploiting JRuby: Building Domain-Specific Languages for the Java Virtual Mac...
 
JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Virtualizing a Virtual Machine
Virtualizing a Virtual MachineVirtualizing a Virtual Machine
Virtualizing a Virtual Machine
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
Javaforum 20110915
Javaforum 20110915Javaforum 20110915
Javaforum 20110915
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 Fast
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications
 
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
 
Chapter 1. java programming language overview
Chapter 1. java programming language overviewChapter 1. java programming language overview
Chapter 1. java programming language overview
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggerated
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 

Mehr von elliando dias

Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introductionelliando dias
 
FleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in ClojureFleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in Clojureelliando dias
 
Clojure and The Robot Apocalypse
Clojure and The Robot ApocalypseClojure and The Robot Apocalypse
Clojure and The Robot Apocalypseelliando dias
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmerselliando dias
 

Mehr von elliando dias (20)

Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
 
FleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in ClojureFleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in Clojure
 
Clojure and The Robot Apocalypse
Clojure and The Robot ApocalypseClojure and The Robot Apocalypse
Clojure and The Robot Apocalypse
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Writing Your Own JSR-Compliant, Domain-Specific Scripting Language

  • 1. Writing Your Own JSR-Compliant, Domain- Specific Scripting Language David Smith, Software Engineer John Colosi, Software Engineer TS-5693
  • 2. Prove the power of Domain Specific Languages to simplify work, communicate ideas, and manipulate space-time 2008 JavaOneSM Conference | java.sun.com/javaone | 2
  • 3. Demonstrate by example some techniques for using Java™ Specification Request (JSR)- 223 to build your own simple, portable Domain Specific Language 2008 JavaOneSM Conference | java.sun.com/javaone | 3
  • 4. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 4
  • 5. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 5
  • 6. What is JSR-223? JSR-223 defines certain contracts between the Java Virtual Machine (JVM™) and a scripting language It covers: • Motivations behind its creation • How the JVM tool will discover available scripting languages at runtime • The classes and interfaces that define relationships between a script engine and the JVM tool Scripting support was introduced with Java 6 platform At scripting.dev.java.net you can find a list of JSR- conforming scripting-language implementations 2008 JavaOneSM Conference | java.sun.com/javaone | 6
  • 7. What is a scripting language? A language whose programs control applications rather than exist as applications on their own Scripts ordinarily contain sequences of commands intended for the target application Usually interpreted Definition has become muddled 2008 JavaOneSM Conference | java.sun.com/javaone | 7
  • 8. What is a DSL? Full of terms and jargon particular to the domain Not necessarily a computer language, even though that’s how engineers might think about them Often impenetrable to outsiders The same way design patterns can be referred to by name and connote lots of information to those knowledgeable 2008 JavaOneSM Conference | java.sun.com/javaone | 8
  • 9. Shared context When there are things we all understand, we can factor them out of the communication DSLs assume a shared context between language user and language interpreter The “domain” in DSL signifies that context 2008 JavaOneSM Conference | java.sun.com/javaone | 9
  • 10. What is Domain Specific Language? Spoken languages are imperfect • Rich • Not concise 2008 JavaOneSM Conference | java.sun.com/javaone | 10
  • 11. What is Domain Specific Language? “The way an object in front of a light source appears darker than it really is” • Silhouette 2008 JavaOneSM Conference | java.sun.com/javaone | 11
  • 12. What is Domain Specific Language? “The strange effect of perspective when a large viewing angle is forced into a smaller viewing angle” • Fisheye 2008 JavaOneSM Conference | java.sun.com/javaone | 12
  • 13. Diamonds in the Rough When my wife says: • “What happened to the last batter?” 2008 JavaOneSM Conference | java.sun.com/javaone | 13
  • 14. Diamonds in the Rough There were runners at First… 2008 JavaOneSM Conference | java.sun.com/javaone | 14
  • 15. Diamonds in the Rough … and Second base… 2008 JavaOneSM Conference | java.sun.com/javaone | 15
  • 16. Diamonds in the Rough … with 1 out… 2008 JavaOneSM Conference | java.sun.com/javaone | 16
  • 17. Diamonds in the Rough … when the batter… 2008 JavaOneSM Conference | java.sun.com/javaone | 17
  • 18. Diamonds in the Rough … hit a pop fly in the infield… 2008 JavaOneSM Conference | java.sun.com/javaone | 18
  • 19. Diamonds in the Rough … The defense could just drop the ball… 2008 JavaOneSM Conference | java.sun.com/javaone | 19
  • 20. Diamonds in the Rough … and turn a double play… 2008 JavaOneSM Conference | java.sun.com/javaone | 20
  • 21. Diamonds in the Rough … to avoid this, the batter was called out… 2008 JavaOneSM Conference | java.sun.com/javaone | 21
  • 22. Diamonds in the Rough … and the runners… 2008 JavaOneSM Conference | java.sun.com/javaone | 22
  • 23. Diamonds in the Rough … hold their positions 2008 JavaOneSM Conference | java.sun.com/javaone | 23
  • 24. Diamonds in the Rough That’s a mouthful 2008 JavaOneSM Conference | java.sun.com/javaone | 24
  • 25. Diamonds in the Rough If David asked the same question… 2008 JavaOneSM Conference | java.sun.com/javaone | 25
  • 26. Diamonds in the Rough Infield Fly Rule 2008 JavaOneSM Conference | java.sun.com/javaone | 26
  • 27. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 27
  • 28. Relationship of computer languages Rich languages (e.g., Java) Scripting languages (e.g., Groovy) Domain-specific languages 2008 JavaOneSM Conference | java.sun.com/javaone | 28
  • 29. DSLs vs. rich computer languages Rich languages start by not knowing what you’re talking about • The Java platform doesn’t know what a bank account is Rich languages must allow for all possibilities of application • You can use C to navigate a space shuttle, C++ to run a backend financial system, and a Java platform to make Duke show up in an applet 2008 JavaOneSM Conference | java.sun.com/javaone | 29
  • 30. Duke 2008 JavaOneSM Conference | java.sun.com/javaone | 30
  • 31. Why use a DSL? Deep Blue is a chess playing computer 2008 JavaOneSM Conference | java.sun.com/javaone | 31
  • 32. Why use a DSL? In 1997, it won a match… …against Gary Kasparov, reigning world champion 2008 JavaOneSM Conference | java.sun.com/javaone | 32
  • 33. Why use a DSL? But Deep Blue doesn’t know the rules of chess… It just has a good memory 2008 JavaOneSM Conference | java.sun.com/javaone | 33
  • 34. Why use a DSL? Deep Blue needs something better than the SQL, the “Standard” Query Language CQL is the “Chess” Query Language 2008 JavaOneSM Conference | java.sun.com/javaone | 34
  • 35. What could this mean? :relation (:missingpiececount A 1) 2008 JavaOneSM Conference | java.sun.com/javaone | 35
  • 36. CQL Syntax CQL syntax Keywords Keywords • K white king k black king • :mate :pattern • N white knight n black knight • :check :relation • B white bishop b black bishop • :wtm (white to move) • P white pawn p black pawn • :terminal (final position) • R white rook r black rook • Q white queen q black queen • A any white piece a any black piece • . empty square U any piece 2008 JavaOneSM Conference | java.sun.com/javaone | 36
  • 37. :relation (:missingpiececount A 1) Find games where White sacrificed a piece to improve his position 2008 JavaOneSM Conference | java.sun.com/javaone | 37
  • 38. CQL CQL was developed by Gady Costeff and Lewis Stiller It is Copyright (c) 2003-2004 and is free 2008 JavaOneSM Conference | java.sun.com/javaone | 38
  • 39. Other DSL examples Wiki markup language SQL • Imagine all the complexity behind this simple command • SELECT /*+ PARALLEL(emp,4) */ COUNT(*) FROM emp ; SPSS – stat *example* Solaris™ Flash technology actionscript – this is pretty rich though AI scripts 2008 JavaOneSM Conference | java.sun.com/javaone | 39
  • 40. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 40
  • 41. Beginning the implementations JSR-223 defines six classes and six interfaces All can be found in the javax.script package These fall into the categories of: • the scripting engine for a language • the context in which a script is running 2008 JavaOneSM Conference | java.sun.com/javaone | 41
  • 42. JSR-223 API: relations between manager and factories ScriptEngine ScriptEngine Factory Manager (language x) ScriptEngine Factory (language y) Service locator ScriptEngine Factory (language z) language language language x y z 2008 JavaOneSM Conference | java.sun.com/javaone | 42
  • 43. JSR-223 API: the ScriptEngineManager The ScriptEngineManager • Auto-discovers scripting lanugaues • Determines which engine factory to give you based on language name, MIME-type, or extension that you supply It’s a factory of factories 2008 JavaOneSM Conference | java.sun.com/javaone | 43
  • 44. JSR-223 API: relations between factories and engines ScriptEngine ScriptEngine ScriptEngine Factory Manager (language x) (language x) ScriptEngine (language x) scripts (language x) 2008 JavaOneSM Conference | java.sun.com/javaone | 44
  • 45. JSR-223 API: the script engine and its factory ScriptEngineFactory • Produces instances of your engine • Maps MIMEs, extensions, and language names to itself • Provides syntax for method calls and output statements • Provides mechanism for building a script from statements ScriptEngine • Interprets and runs (“evaluates”) your scripts • Requires you to implement overloaded eval() method for script interpretation 2008 JavaOneSM Conference | java.sun.com/javaone | 45
  • 46. Code example: hello world // get Groovy engine from the SEM ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine groovyEng = sem.getEngineByName( "groovy" ); // run a script groovyEng.eval( "println 'hello world'" ); 2008 JavaOneSM Conference | java.sun.com/javaone | 46
  • 47. JSR-223 API: closer look at ScriptEngine class public Object eval ( ... ) throws ScriptException The ( ... ) can be • String • Reader • String, ScriptContext • Reader, ScriptContext • String, Bindings • Reader, Bindings 2008 JavaOneSM Conference | java.sun.com/javaone | 47
  • 48. JSR-223 API: Interactions between a Java platform application and an engine Java application ScriptEngine Manager ScriptContext { ScriptEngine … Factory Bindings Java code … } Bindings ScriptEngine 2008 JavaOneSM Conference | java.sun.com/javaone | 48
  • 49. JSR-223 API: the script’s runtime context Bindings • Holds name-value pairs • Objects can be bound into, retrieved from, and removed from the Bindings by both the script and the Java platform caller to the script ScriptContext • Context in which scripts run • Provides access to scoped Bindings • Provides reader and two writers (standard, error) for script input and output 2008 JavaOneSM Conference | java.sun.com/javaone | 49
  • 50. JSR-223 API: Bindings hierarchy Bindings have scopes • Global scope – can be set in the ScriptEngineManager or the ScriptEngine before script evaluation • Engine scope – can be set in the ScriptEngine before script evaluation • “Local” scope – can be passed in at script-evaluation time and used for that evaluation only The ScriptEngine will look for a specific binding (property in a Bindings) by going from local to engine to global scope 2008 JavaOneSM Conference | java.sun.com/javaone | 50
  • 51. Code example: round trip with “local” bindings // get the Groovy engine from the SEM ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine groovyEng = sem.getEngineByName( "groovy" ); // create some bindings for our script run Bindings runBindings = groovyEng.createBindings(); runBindings.put( "greeting", "hello from script" ); // run the script and supply those bindings groovyEng.eval( "println greeting", runBindings ); 2008 JavaOneSM Conference | java.sun.com/javaone | 51
  • 52. JSR-223 API: helper classes SimpleBindings SimpleScriptContex AbstractScriptEngine 2008 JavaOneSM Conference | java.sun.com/javaone | 52
  • 53. JSR-223 API: optional engine facilities Compilable Invocable 2008 JavaOneSM Conference | java.sun.com/javaone | 53
  • 54. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 54
  • 55. Writing your own language: how and where to start? Sometimes the biggest hurdle is getting started JSR-223 is a friendly, welcoming specification DSLs are only and exactly as difficult to write as you decide they will be 2008 JavaOneSM Conference | java.sun.com/javaone | 55
  • 56. Start at the end What should the eventual script look like? • Syntax • Semantics What features do you want to support? • What are the nouns that will be important? • What verbs – what actions? 2008 JavaOneSM Conference | java.sun.com/javaone | 56
  • 57. An example script showMap zipcode=22207 setZoomLevel 15 showIcons schools showIcons libraries plotRoute mySavedRoute 2008 JavaOneSM Conference | java.sun.com/javaone | 57
  • 58. Begin implementation with AbstractScriptEngine Have createBindings() return a new SimpleBindings Consolidate the two remaining eval() methods • private Object eval(final Reader reader, final Bindings bindings, final ScriptContext context) throws ScriptException Implement the new eval() method • Start with “Hello World” • Write a test that calls all of the different public eval() methods 2008 JavaOneSM Conference | java.sun.com/javaone | 58
  • 59. Write your ScriptEngineFactory None of its methods require any computation! Two of its methods deal with your script’s syntax • getMethodCallSyntax(…) requires some thought, but not much • getProgram(…) requires even less thought Write a test to grab the engine from the factory and execute a script 2008 JavaOneSM Conference | java.sun.com/javaone | 59
  • 60. Package it properly Use the service-provider convention for auto discovery • META-INF • /services • /javax.script.ScriptEngineFactory • com.my.script.MyScriptEngineFactory Write a test to get your ScriptEngineFactory via the ScriptEngineManager 2008 JavaOneSM Conference | java.sun.com/javaone | 60
  • 61. Ummm… you’re now JSR-compliant! You’re almost done! You now have to change your new ScriptEngine’s private eval() method to do more than “Hello World” • Unless your intention was to have a HelloWorldScriptEngine • There’s nothing wrong with that, by the way 2008 JavaOneSM Conference | java.sun.com/javaone | 61
  • 62. Advanced parsing If your language is complex, separate/encapsulate the parse and the execute concerns • Try ANTLR for parsing • Consider implementing Invocable and Compilable if you have a compilation step separate from the execution However, a complicated language means fewer users 2008 JavaOneSM Conference | java.sun.com/javaone | 62
  • 63. Extending your interpreter Want to get fancy? • Support variables • Allow output redirection • Allow input redirection • Provide extensive error messages (ScriptException supports line- number support) • …what else…? What implicit procedures and variables will you expose to all scripts? • Unique ID generator? • Logging? 2008 JavaOneSM Conference | java.sun.com/javaone | 63
  • 64. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 64
  • 65. Case studies John & David are Java platform programmers John’s into video games David’s into music They understand the basics of the JSR 2008 JavaOneSM Conference | java.sun.com/javaone | 65
  • 66. David’s MP3 player filter band=Wolfhounds shuffle on repeat on play 2008 JavaOneSM Conference | java.sun.com/javaone | 66
  • 67. The Gaming Revolution The Next Big Thing 2008 JavaOneSM Conference | java.sun.com/javaone | 67
  • 68. The Old School 2008 JavaOneSM Conference | java.sun.com/javaone | 68
  • 69. The New School 2008 JavaOneSM Conference | java.sun.com/javaone | 69
  • 70. The Gaming Revolution I want to make a language that asserts the basic principles of game play I wish I could cheat and write something like this: • Jump once • If I’m near the top of my jump, then assert that I can jump again • If I’m not, then assert that I can’t jump Can’t we all just get along If I need a test case for my test case, it’s too complicated 2008 JavaOneSM Conference | java.sun.com/javaone | 70
  • 71. Enter Gameplan: The Gameplay Description Language Do • Simple commands like “JUMP” • Assignments like Health=25 Wait – {} • Simple commands like “{Standing}” • Assignments like {Height<300} • Comparisons like {ShotsInTheAir=0} • Sleep like {2000} Assert – [] • Simple commands like “[JUMPING]” • Assignments like [Ammo = 100] • Comparisons like [Lives > 0] 2008 JavaOneSM Conference | java.sun.com/javaone | 71
  • 72. Example Gameplan file # Double jump jump {nearpeak} jump [height>300] # Can’t jump when you’re rolling roll [rolling] {200} jump [height=0] # Shooting maxshotsintheair=1 shoot [shotsintheair=1] shoot shoot [shotsintheair=1] # Upgrade maxshotsintheair=4 shotsintheair=0 shoot [shotsintheair=1] shoot shoot [shotsintheair=3] 2008 JavaOneSM Conference | java.sun.com/javaone | 72
  • 73. Verisign Gameplan Implementation (VGI) One object method • GamplanScriptEngine.eval(String, context) One properties file • Gameplan.definition.txt One Registration file • javax.script.ScriptEngineFactory 2008 JavaOneSM Conference | java.sun.com/javaone | 73
  • 74. GamplanScriptEngine.eval(String, context) public Object eval(String script, ScriptContext context) throws ScriptException { // Start the Game object // Foreach line of input // If it looks like [***] // Assert the condition inside // If it looks like {***} // Wait on the condition inside // Otherwise // Change the state of the Game object // Stop the Game object } 2008 JavaOneSM Conference | java.sun.com/javaone | 74
  • 75. Gameplan.definition.txt script.extensions = .game .gp script.mimetypes = text/plain application/gameplan script.name.short = Gameplan script.name.long = Gameplan - Gameplay Description Language script.name.list = Gameplan gpln gp GDL script.version = 1.0 engine.name = Verisign Gameplan Interpreter engine.class = com.vrsn.script.GameplanScriptEngine engine.version = 2.3 2008 JavaOneSM Conference | java.sun.com/javaone | 75
  • 76. javax.script.ScriptEngineFactory /META-INF/services/javax.script.ScriptEngineFactory • com.vrsn.script.gameplan.GameplanScriptEngineFactory 2008 JavaOneSM Conference | java.sun.com/javaone | 76
  • 77. VeriSign Gameplan Interpreter 2008 JavaOneSM Conference | java.sun.com/javaone | 77
  • 78. The Gaming Revolution Don’t worry, we’ve slowed down the game for demonstration purposes. The real version will run almost 10% faster! 2008 JavaOneSM Conference | java.sun.com/javaone | 78
  • 79. The Gaming Revolution I know what you’re thinking, does this game really revolutionize gaming… 2008 JavaOneSM Conference | java.sun.com/javaone | 79
  • 80. John & David write their DSLs, get traction MP3-player users love scripting their players Videogame users love scripting their players Because they’re so easy to use, others besides intended users pick up on them • QA for MP3 player want to start using it • {…some people besides users…} for videogame wanna use it 2008 JavaOneSM Conference | java.sun.com/javaone | 80
  • 81. Allow plugins Allow for people to add to the language dynamically via plugins Plugins implement callback for handling script commands public interface ScriptPlugin { handleLine (String scriptLine) } Plugins register their triggering keywords with scripts. Interpreter routes triggered commands to plugins 2008 JavaOneSM Conference | java.sun.com/javaone | 81
  • 82. Registration mechanism # register ‘assert’ plugin with engine plugin assert com.verisign.mp3.qa.Assertions # validate that plugin is working assert activeSongCount=0 2008 JavaOneSM Conference | java.sun.com/javaone | 82
  • 83. QA script # validate filter features filter genre=downtempo assert activeSongCount=33 assert activeGenre=downtempo saveFilter myTestFilter clearFilter assert activeSongCount=0 loadFilter myTestFilter assert activeSongCount=33 assert activeGenre=downtempo 2008 JavaOneSM Conference | java.sun.com/javaone | 83
  • 84. Videogame marketing folks you can have your Java platform code generate and execute such scripts while running you can save yourself compilation, build, packaging, and deployment cycles by separating the dynamic logic from the application proper 2008 JavaOneSM Conference | java.sun.com/javaone | 84
  • 85. Synergy between music fans and gamers What gamer doesn’t want to control the game’s soundtrack? Gamers want to use their own music Gamers want the right music for the right moment 2008 JavaOneSM Conference | java.sun.com/javaone | 85
  • 86. The beauty of JSR-223 compliance Because the scripting languages share common interfaces… Because the JSR specifies a discovery mechanism… Because the calling program doesn’t need to know anything about the language… The languages become interoperable 2008 JavaOneSM Conference | java.sun.com/javaone | 86
  • 87. Combination script {{ some Gameplan stuff }} [[[ mp3 filter band=Wolfhounds shuffle on repeat on play ]]] {{ more Gameplan }} 2008 JavaOneSM Conference | java.sun.com/javaone | 87
  • 88. Agenda Background on JSR-223, scripting, and DSLs Domain Specific Languages in detail Walk-through of JSR-223 Writing your own DSL DSL Case Studies Jumpstart your development 2008 JavaOneSM Conference | java.sun.com/javaone | 88
  • 89. Introducing ScriptBlend Non-intrusive means of embedding different languages in the same script Scripts can share variables with one another Foreign script snippets can be inserted into flows midstream 2008 JavaOneSM Conference | java.sun.com/javaone | 89
  • 90. ScriptBlend: Midstream insertion echo “hello” [[[ groovy for ( i in 1..5 ) { ... ]]] echo “hi from native script” [[[ ... } def groovyHi = "hi from groovy"; scriptGlue.publish("groovyHi", groovyHi); ]]] echo ${groovyHi} 2008 JavaOneSM Conference | java.sun.com/javaone | 90
  • 91. More on ScriptBlend Supports nesting of foreign scripts (e.g., JavaScript™ technology snippet inside a Groovy snippet inside a Beanshell snippet) Provides a simple way to enable the ScriptEngineManager, individual ScriptEngineFactories, and individual ScriptEngines to interpret blended scripts Possible Eclipse plugin for creating and editing blended scripts More to follow…? 2008 JavaOneSM Conference | java.sun.com/javaone | 91
  • 92. Excited to get started scripting? We have a starter kit to get you going Simplifies an already-friendly API 2008 JavaOneSM Conference | java.sun.com/javaone | 92
  • 93. Starter Kit Implementations of JSR-223 must provide a factory and engine, but some common functionality can be assumed • VerisignScriptEngineProperties • Loads properties from a resource • VerisignScriptEngineFactory • Loads Engine specified in the properties • VerisignScriptEngine • Reads input scripts intelligently • Funnels all eval methods into one which you implement All that’s left is to dream up the language 2008 JavaOneSM Conference | java.sun.com/javaone | 93
  • 94. Presentation Map John and David’s JSR-223 Simple Framework Gameplan Gameplay DSL Music Description VGI Language Interaction VeriSign Gameplan Language Interpreter Advanced Techniques Gameplan Examples Where to go from here 2008 JavaOneSM Conference | java.sun.com/javaone | 94
  • 95. Summary Domain Specific Languages provide portable power in a simple box that even the business guys can understand Build a rocket ship with a one page manual that your customers can operate 2008 JavaOneSM Conference | java.sun.com/javaone | 95
  • 96. For More Information List • Cross-references to other sessions • BOFs • URLs • Related books, etc. 2008 JavaOneSM Conference | java.sun.com/javaone | 96
  • 97. Image Attributions Creative Commons License • First Base Flickr user timailius • Second Base Flickr user billaday • 1 out Flickr user newyork808 • Batter Flickr user pingnews • Fly ball Flickr user foreverdigital • Dropped ball Flickr user hobbes8calvin • Double play Flickr user Michael (mx5tx) • Umpire Flickr user Tom Clifton • Deep Blue Flickr user davespilbrow • Chess Pieces Flickr user Shefaet • Earth Flickr user susemueller • Silhouette Flickr user jekkyl • Fisheye Flickr user ValterJacinto • Baseball Flickr user B Tal Stock Xchng, Public License • Thunderbirds2 Rocketship 2008 JavaOneSM Conference | java.sun.com/javaone | 97
  • 98. David Smith, Software Engineer John Colosi, Software Engineer TS-5693 2008 JavaOneSM Conference | java.sun.com/javaone | 98