Design Your Own DSL with Groovy
Published June 8th, 2010 Under Coding | Leave a Comment
Guillaume Laforge explains what makes Groovy to be better suited to create a DSL: closures, meta-programming, operator overloading, named arguments, a concise and expressive syntax, demonstrating how to write a DSL in Groovy.
http://www.infoq.com/presentations/Design-Your-Own-DSL-with-Groovy
Gant, the Lightweight and Groovy Targeted Scripting Framework
Published January 6th, 2010 Under Coding, Open Source Tools | Leave a Comment
Gant started out as a thin layer over Groovy’s AntBuilder, to provide a way of replacing XML as the way of controlling Ant tasks in executing specific targets. This more or less remains what Gant is really about: Gant doesn’t simply replace the XML front end to Ant, it provides target specification and dependency for Groovy scripts that use an AntBuilder. There was some flirtation with Gant becoming a fully-fledged build framework, but Gradle evolved out of Gant to take up that torch. Gant’s role then is to be very lightweight and yet provide useful functionality in terms of command line and direct API support for specifying targets to execute and scripting execution of Ant tasks. In this talk we will look at the Groovy techniques used in Gant to provide the functionality it does. Particular emphasis will be placed on using (or not) the metaclass system, and how to design (or more likely evolve) a domain specific language (DSL) to be well supported by the Groovy language.
Watch this video on Skillsmatter.com
Building DSLs: Marriage of High Essence and Groovy Metaprogramming
Published January 5th, 2010 Under Architecture, Coding | Leave a Comment
DSLs or Domain Specific Languages focus on a domain or a particular problem. They serve as an effective human-machine interaction tool as they’re highly expressive. Their scope is fairly focused and that keeps them simple and small from the user’s point of view. However, designing and implementing DSLs is not easy. Typically this involves steep learning curve and difficult parsing techniques. This is where Groovy comes in. You can take advantage of the flexible syntax of Groovy and it’s metaprogramming capability to create what are called internal DSLs, that is, DSLs hosted using a higher level language. In this fast paced highly interactive presentation you will start out learning the characteristics and types of DSLs. Then you will learn about the challenges in designing DSLs and deep dive into Groovy features that can ease the pain of implementing DSLs. Then, using some live coding, Venkat will show you how to create and implement internal DSLs using Groovy. Along the way you’ll learn some tricks to facilitate desirable syntax for your DSL.
Watch this video on Sskillsmatter.com
Jive Talkin’: DSL Design and Construction
Published January 4th, 2010 Under Coding | Leave a Comment
This is a talk on DSL purpose, design, and construction. There’s a lot of FUD for and against DSL’s, and hopefully this presentation will cut through a lot of the B.S. and present the costs and benefits in a straightforward and intellectually honest manner with a pinch of sarcastic humor and a dash of LOLCATS. It’ll kick off with a discussion of what a DSL is and isn’t, the distinction between internal and external DSL’s, and what benefits these little languages confer to the users. Next, I’ll take a few common DSL’s from the Ruby world and discuss how they work, why they work so well for what they do, and if any adjustments could be made to their syntax or implementation that would improve their effectiveness.
DSLs, Code Generation, and New Domains for Ruby
Published December 28th, 2009 Under Architecture, Coding | 2 Comments
Ruby’s success in several domains is arguably due to domain-specific languages (DSLs) that generate code: we have tools that generate HTML, CSS, and Javascript, and so we get to write web applications in ruby; ditto SQL and database applications. There are some less well known examples in the simulation and embedded real-time domains, with native code generation. Two other domains are ripe for the same treatment: animation and network programming. My talk focuses on these four cases, two existing and two hypothetical.
keep looking »