ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <...@apache.org>
Subject Re: scala and groovy
Date Fri, 13 Dec 2013 18:16:10 GMT
On 13.12.2013, at 15:27, Steven Bethard <steven.bethard@gmail.com> wrote:

> P.S. I've stayed out of this whole Groovy thing because we (at
> ClearTK) had some bad experiences with Groovy in the past. Mainly with
> Groovy scripts getting out of sync with the rest of the code base,
> just like XML descriptors, though perhaps the IDEs and Maven are
> better now and that's no longer a problem? But this whole "grape"
> thing instead of standard Maven isn't changing my mind. Not that I
> planned to switch away from Scala for my scripting anyway, but...


I heard and read about your bad experiences with Groovy. I believe
that the IDEs got somewhat better at handling Groovy. However, I think a
difference needs to be made depending on the use case.

Some people use the XML files as a format to exchange pipelines
with each other. However, alone, these files are not of much use.
One benefit of using Groovy as a pipeline-exchange format is, that
it can actually get all its dependencies itself via Grape. The
Groovy script is quite self-contained (although it relies on the
Maven infrastructure for downloading its dependencies).
Another is, that thanks to uimaFIT, the Groovy code is much less
verbose than the XML descriptors.

At the UKP Lab, we also use Groovy sometimes for high-level experiment
logic. For us, it is a good compromise between inflexible and
verbose XML files and flexible and verbose Java code. Groovy is flexible
and concise and the IDE support is meanwhile reasonable.

Mind that the IDE support for Grapes (at least in Eclipse) is hilarious.
Grapes cause the IDE to become quite unresponsive as the artifact resolution
is now well integrated into the IDE.

So here is my summarized opinion when to use or not to use Groovy:

== Examples / Exchange ==

In order to get quick results for new users and to showcase the capabilities
of a component collection such as DKPro Core or cTAKES, I think the Groovy scripts
are a convenient vehicle. At DKPro Core, we also packaged all the resources (models)
as Maven artifacts, which gives us an additional edge over the manual downloading
currently happening in the cTAKES Groovy prototypes.

== High-level experiment orchestration ==

Groovy can be useful for high-level experiment coordination. We mostly use it
to conveniently set up parameter spaces and high-level tasks in DKPro Lab [1]
and DKPro Text Classification [2] to do parameter sweeping experiments. In
particular the closures are helpful here and the shorthand for setting up maps, lists, etc.

== Reusable code and components ==

I would not recommend Groovy for lower-level code, e.g. for writing framework-level
code such as reusable analysis engines or library code. Mind, the IDE support got
better, but is is not perfect. At the lower levels, one definitely wants to have
strict type checking and a picky compiler.

Cheers,

-- Richard

[1] https://code.google.com/p/dkpro-lab/
[2] http://code.google.com/p/dkpro-tc/
Mime
View raw message