Readers this blog may know that's possible to mix Groovy and Scala code in the same Griffon application (link 1, link 2, link 3). For a time using Scala within a Griffon application required you to still write MVC artifacts with either Groovy (the default) or Java, in a sense Scala support was confined to helper classes. But this has changed in the spirit of true polyglot programming.
Starting with the latest release (0.9.5-rc2, released last Friday) you can create a Griffon application where any of the base artifacts may be written using Scala. Here's how you can test it for yourself:
- Download a copy of Griffon 0.9.5-rc2 from the download page, install it and configure the Griffon command on your path.
- Install the Scala archetype.
- Create a new application, make sure to specify you want to use the scala archetype.
Executing step #2 results in a similar output like the following one
Good, we now have the Scala archetype installed in our Griffon distribution, in other words, it has become available and can be used in conjunction with the create-app command. Which is exactly what will do for step #3
This will initialize the application in such a way that the sources of the default MVC group will use Scala instead of Groovy, as witnessed by the following screenshot

If you inspect the contents of each file you'll find that they do in fact contain Scala code (a Java-ish kind of Scala code really). Notice also on the output of the create-app command that two plugins were installed, once of them is the Scala plugin.
You can run the application as you would do with any other Griffon application, just type griffon run-app and you're in business. From here on it's just a matter of changing the source code to make it behave as you want to. Any additional MVC groups that you may create will also use Scala as the source language. Remember that you can still mix & match Java and Groovy code anywhere in the application, but keep in mind the following rules until there's true interoperability between all compilers
- Java code in src/commons gets compiled first.
- Scala code in src/commons-scala gets compiled second.
- Java/Groovy code in griffon-app/* and src/main gets compiled next.
- finally, Scala code in griffon-app/* and src/main gets compiled at the last step.
If any Scala enthusiasts would like to help us make the Scala experience in Griffon even better then don't hesitate to ping us at the Griffon mailing lists or send us a message to @theaviary.
Keep on Groovying!