Eclipse Command Language
Cracow, Poland
Eclipse Day 2012, September 13
Bartosz Czerwiński [email protected] Eclipse Command Language Agenda . DSL . Scripting in Eclipse . ECL –Core Concepts –Architecture –Applicability –Future . Live Demo
14 September 2012 2 DSL
14 September 2012 3 Eclipse Command Language Domain Specific Language . Most languages are general purpouse languages . Language Oriented Programming * . Domain-Specific Language (noun): a computer programming language of limited expressiveness focused on a particular domain * . Why do we need DSLs?
* Martin Fowler
14 September 2012 4 Eclipse Command Language Types of DSLs . Internal (Embedded) – a particular idiom of writing a code in a host language – Fluent Interfaces (Method Chaining) – Flexible Syntax – Method Missing – Reflection (Annotations) . External – a separate language or a set of resources that facilitate the way of how a user is interacting with its environment within a particular domain
14 September 2012 5 Eclipse Command Language Scripting in Eclipse Platform . EclipseShell – http://eclipse-shell.sourceforge.net/ . Eclipse Monkey – Task automation and scripting, API exploration – Based on Groovy Monkey Project – http://www.eclipse.org/proposals/eclipse-monkey/ . Eclipse Glimmer – JRuby DSL for developing user interfaces – http://www.eclipse.org/proposals/glimmer/
14 September 2012 6
ECL
14 September 2012 7 Eclipse Command Language Eclipse Command Language
echo „Hello World”
14 September 2012 8 Eclipse Command Language Eclipse Command Language . Scripting and Automation Framework . Easily Extensible & Flexible . Command-oriented . Distributed . Q7 Platform scripting language . Entirely open-source . Introduced by Xored Software at EclipseCon 2008
14 September 2012 9
Eclipse Command Language Core concepts . Model Driven Engineering . Functional Programming . REST . SOA . TCL . Microsoft® PowerShell™ . Unix pipes
14 September 2012 10 Eclipse Command Language What’s under the hood?
Eclipse Modeling Framework . Meta description of domain-specific model
Commands . Actual implementation of domain-specific logic
Pipes . Provide means of communication between commands
Script-lets . Abstraction layer above commands, pipes (DSL specific)
Eclipse Extension Points . Effectively associate Scriptlets with commands
14 September 2012 11 Eclipse Command Language Scriptlet . An independent unit (Actor) . Stateless . Pipes are (conceptually) immutable
Scriptlet Pipe
list-plugins EMF Objects sort-by
Command
Eclipse ExtensionPoints Eclipse ListPluginsService SortByService
14 September 2012 12 Eclipse Command Language Scriptlet c.d. . Domain Model
. Distributed communication
S S
S TCP/IP S S
14 September 2012 13 Eclipse Command Language Applicability
Desktop Applications Web Applications Distributed Systems
. Scripting & Automation . Scripting & Automation . Scripting & Automation . Instrumentation . Mash-ups . Remote Control . Productivity . Remote Support . Issue Tracking . DSL Admin Toolkits . Issue Investigation . DSL Toolkits
14 September 2012 14 Demo 1
14 September 2012 15 Eclipse Command Language Telnet Console . Core features . Interacting remotely with Eclipse UI
14 September 2012 16 Demo 2
14 September 2012 17 Eclipse Command Language Q7 . Functional and UI testing platform . Handcrafted for Eclipse . Runtime Intelligence . State Management . Utilizes ECL as its core scripting language
14 September 2012 18 Eclipse Command Language Future . Comprehensive DSL orchestration
... | get-dom-nodes „a” | foreach js:{set-attr target „_top”} ... | get-list | script python:{sorted( $_, key=itemgetter(1) )} . Truly distributed get-data-sets | host1:remove-duplicates \ | host2:get-graphviz-layout twopi . Code Injection get-data-set calls | get-node –query „self.duration < 13” . ECL core in other languages (Python, Scala, Ruby, ...) and their interoperability
14 September 2012 19 Thank you!
Special thanks to Andrey Platov and Ivan Inozemtsev from Xored Software Inc.
14 September 2012 20 Eclipse Command Language Resources . Sources and Extenstions – https://github.com/xored/ecl/ – https://github.com/xored/q7.extensions.ecl . API (http://download.xored.com/q7/docs/ecl- api/1.2.4.html) . New Command Guide (http://help.xored.com/display/ECL/New+Command +Guide)
14 September 2012 21