hansamann

Archive for May 7th, 2008

Dynamic Languages Panel

In Grails, Groovy on May 7, 2008 at 4:54 pm
Dynamic Languages Panel

Dynamic Languages Panel,
originally uploaded by hansamann.

I was also at the Dynamic Languages Panel, I think it is press only which could potentially make it boring. Let the crowd in I would say but I am not Sun. I is hosted by Tim Bray of Sun.

Participants:
Charlie Nutter, JRuby
Guillaume Laforge, Groovy (not confirmed)
Frank Wierzbicki, Jython
Ted Leung, Python/Jython
Greg Murray, Ajax, jMaki
Tor Norbye, Tooling

It’s tough to live blog that, but I will try to outline the key questions asked.

The panel begins with an unpleasant question that is more targeted at Sun that at the panelists. Why is there a new scripting language for javaFX, why not use Groovy (or other languages that exist already, like javascript)?
Tim: javaFX is tightly coupled with Swing, easy to integrate authoring, media, etc. Groovy is more generic. Another Sun guy steps in, tries to explain why a new language was used. Bottom line: I guess groovy would have been a perfect choice, but Sun decided differently.

I think the discussion is going into a slightly unfavorable direction for Sun right now…. still all argueing why javaFX needs to be. Hmm.

The discussion now switches to debugging. Guillaume mentions that the stack is different if your are debugging Groovy, but besides this oyu can use the same tools.

Charles Nutter says that many times the test/deploy cycles are so short, that debugging has become somewhat obsolete…

I started Twitering… this is kind of difficult to blog about. Check my Twitter page: http://twitter.com/hansamann

Now I know why Twitter exists. If the quality is not good enough for blogging, you can always twitter it!

Scott Davis: Groovy – The Red Pill

In Grails, Groovy on May 7, 2008 at 9:44 am
Scott Davis

Scott Davis,
originally uploaded by hansamann.

I am waiting for Scott Davis’ show to begin. He is still busy signing his book, Groovy Recipes :-) and I just noticed I don’t have that book yet… what a shame, have to order or get it today. Scott is also the creator of aboutGroovy.com, a news site dedicated purely to Groovy news.

Damn no Wifi in this room… what the hell is going on with JavaOne? I better keep writing this to Stickies instead of the online wordpress blog post page.

Scott makes a bold point that Groovy/Java Integration is seamless, really seamless. Mentioning the Foreword of Groovy in Action by James Gosling: smooth and efficient integration with Java. Other scripting languages got many syntactic mismatches… for Java Developers Groovy is painless.

Rest of the session will be live coding. He covers: Method Pointers, Operator Overloading, Closures, ExpandoMetaClass (invokeMethod,methodMissing)

Uses Textmate. Starts with a Hello World Java example. Javac’s it, runs it. Now the same in groovy. Of course that’s println ‘Hello Groovy’ :-) done. He talks about some more basics of Groovy like optional parenthesis.

Method Pointers
Make a great example of method pointers in Groovy and how it helps to create dsls.

songs = [1,2]

load = songs.&add
load 3

println songs
[1,2,3]

Moves on to GroovyBeans and all the stuff you don’t have to write… semicolons, return statements, gettter/setter. Also gives an example for GStrings, you should order one.

Closures & ExandoMetaClass
Jumping into a basic closure example and then comparing for-loop in Java to Groovy’s Integer.times() method that results in sth. like 7.times {println ‘hi’}. He also covers operator overloading, example with Date and using ++ to advance to the next day. He is now extending String with String.metaClass.methodName to add a shout() method that upperCases a String. Nice eye-opener I guess. So we moved into the next topic, ExpandoMetaClass (the coolest thing on earth).

He explains why this is a great feature for testing. You can just replace calls to real functionality with a fake method. He recommends to get started with Groovy with testing… Testing as an drug.

Jumping into the goodness of the GDK, quickly showing some examples (most for java.io.File).

Whoops. We missed the TestCase. Creating one. Extending form GroovyTestCase and testing his new Ipod class he used for the previous examples. We are adding the leftShit method to add Song objects to the Ipod via << new Song().

Scott now talks about invokeMethod / methodMissing. Grails GORM methods are a good example for the methodMissing. These methods don’t exist, but Grails then parses the method name and creates the queries accordingly.

That’s the end. Scott is a very enthusiastic speaker, great session. Hope to meet him later on and chat with him. I am off to upload that text and then head to the next sesion. I think it is a press only panel about dynamic languages. I hope Guillaume can be here as he was not confirmed.

JavaOne – just arrived…

In Grails, Groovy on May 7, 2008 at 8:04 am
Groovy Crowd

Groovy Crowd,
originally uploaded by hansamann.

And the first thing that happened I bumped into Dierk Koenig and Adam Bien. Dierk Koenig is the author of Groovy in Action and Adam is a known Java Author, too (EJB books, projects like GreenFire, etc.). Unfortunately had to find out that Graeme Rocher, Grails Project Lead, is ill and at home in London. So the planned interview with im and Guillaume won’t be possible, but let’s see if I can find Guillaume later.

My first session will lead me to Scott Davis, it is called Groovy the Red Pill and is abou Mopping up Groovy – Groovy & it’s Meta Object Protocol.