Building domain-specific languages with Groovy

35
Building domain- specific languages with Groovy Yaroslav Yermilov Senior Software Engineer, EPAM Systems

Transcript of Building domain-specific languages with Groovy

Page 1: Building domain-specific languages with Groovy

Building domain-specific languages with Groovy

Yaroslav YermilovSenior Software Engineer, EPAM Systems

Page 2: Building domain-specific languages with Groovy

About meYaroslav YermilovSenior Software Engineer, student

https://ua.linkedin.com/pub/yaroslav-yermilov/58/682/506https://www.facebook.com/yaroslav.yermilovhttps://twitter.com/yermilov17

http://megamozg.ru/post/7256/

fond of Java, complete code, big data, data science, Groovy

Page 3: Building domain-specific languages with Groovy

A domain-specific language (DSL)is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains, and lacks specialized features for a particular domain.

DSL?

A domain-specific language (DSL)is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains, and lacks specialized features for a particular domain.

http://en.wikipedia.org/wiki/Domain-specific_language

Page 4: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 5: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 6: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 7: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 8: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 9: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 10: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 11: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

DSL or not a DSL?

DSL

NO

Quiz!

Page 12: Building domain-specific languages with Groovy

DSL or not a DSL?

DSL

NO

Quiz!

http://stackoverflow.com/questions/1642028/what-is-the-name-of-the-operator

Page 13: Building domain-specific languages with Groovy

DSL or not a DSL?

DSL

NO

https://github.com/yermilov/groovy-dsl/tree/develop/examples/dsl-or-not-a-dsl

Quiz!

DSL or not a DSL?

DSL

NO

Page 14: Building domain-specific languages with Groovy

How to build DSL?

Page 15: Building domain-specific languages with Groovy

Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, forthe Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax. Itintegrates smoothly with any Java program, and immediately delivers to your application powerful features, including scriptingcapabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functionalprogramming.

http://www.groovy-lang.org/

Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, forthe Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax. Itintegrates smoothly with any Java program, and immediately delivers to your application powerful features, including scriptingcapabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functionalprogramming.

http://www.groovy-lang.org/

Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, forthe Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax. Itintegrates smoothly with any Java program, and immediately delivers to your application powerful features, including scriptingcapabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functionalprogramming.

Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, forthe Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax. Itintegrates smoothly with any Java program, and immediately delivers to your application powerful features, including scriptingcapabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functionalprogramming.

Groovy?

Page 16: Building domain-specific languages with Groovy

Groovy

Page 17: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 18: Building domain-specific languages with Groovy

Notes:concentrate more on possibilities

concentrate less on technical detailssomething is unclear - ask

want to discuss - you are welcome after the talk

Page 19: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 20: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 21: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 22: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 23: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 24: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 25: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 26: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 27: Building domain-specific languages with Groovy

https://github.com/yermilov/groovy-dsl

Page 28: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl

Page 29: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl

Page 30: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl/tree/develop/examples/existing-dsls

Page 31: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl/tree/develop/examples/existing-dsls

Page 32: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl/tree/develop/examples/existing-dsls

Page 33: Building domain-specific languages with Groovy

Groovy existing DSLs

https://github.com/yermilov/groovy-dsl/tree/develop/examples/existing-dsls

Page 34: Building domain-specific languages with Groovy

Looking further

http://www.groovy-lang.org/dsls.html

http://www.groovy-lang.org/

Page 35: Building domain-specific languages with Groovy

Thanks!