Migrating the core of Gradle to Java

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Migrating the core of Gradle to Java

hans_d
Administrator
Hi all,

the performance problems of the 0.2 release Ittay has pointed out  
made me refactor important bits of the gradle core from Groovy into  
Java. The problem is solved now  (in my local working copy), although  
there is still room for further improvement. One way of further  
improving performance is to rewrite the other gradle core classes in  
Java. This has also a couple of other benefits:

- Rewriting the core into Java would be necessary anyway as soon as  
we want to support additional build script languages (e.g. Jython,  
JRuby).
- Profiling Groovy code is very hard (the same would be true for any  
other dynamic language on the JVM). This is caused by the dynamic  
method dispatch. I don't know if it possible to improve the profiling  
tools to better support dynamic languages. Right now it is a pain.
- The Groovydoc tool is not production ready and it is unclear when  
this is the case. Therefore Gradle can't provide reasonable API docs  
at the moment. Obviously with Java that would not be a problem.
- Reporting is better. For example the code coverage tools don't work  
that well with Groovy. They give you a number but this number is not  
necessarily correct.

As Groovy is so close to Java, refactoring the Groovy code into Java  
is rather easy. I'm a bit sad of having to give up some very nice  
Groovy language elements, but that is the way it is. We will end up  
with only a small Groovy layer left, responsible for applying the  
build script against the Gradle objects. This layer would constitute  
our Groovy build script engine. It should be very easy then to add  
other build script engines for any other dynamic JVM language capable  
of calling Java code and creating Java objects (e.g. coercing a  
closure to a Java interface).

I should be done with the refactoring sometimes next week. The only  
change for the users will be better performance and a usable API doc.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Migrating the core of Gradle to Java

Detering Dirk-2
Hello Hans,

I read in the roadmap that Scala plugin is planned,
but for a post 1.0 release, what is a pity in my eyes,
as I think Scala and Gradle could benefit both from
it regarding publicity.
But ok, one has to prioritise, I suppose.

Regarding:
> We will end up with only a small Groovy layer left,
> responsible for applying the build script against the Gradle
> objects.
...
> It should be very easy then to add other build script
> engines for any other dynamic JVM language capable of calling
> Java code and creating Java objects (e.g. coercing a closure
> to a Java interface).

It would be interesting to find a wiki page containing
the requirements for a JVM language to be applicable as
build language on top of the gradle core.

For example: What does 'dynamic' exactly mean in this context?

Scala e.g. is a powerful language in many ways (and fast),
though, would it match?

KR
Det


***********************************************************************

Die Information in dieser email ist vertraulich und ist ausschliesslich
fuer den/die benannten Adressaten bestimmt. Ein Zugriff auf diese
email durch andere Personen als den/die benannten Adressaten ist
nicht gestattet. Sollten Sie nicht der benannte Adressat sein, loeschen
Sie bitte diese email.

***********************************************************************

BITMARCK Software GmbH
Paul-Klinger-Strasse 15, 45127 Essen
 
Amtsgericht Essen HRB 20680
Geschaeftsfuehrer: Frank Krause, Andreas Prenneis


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Migrating the core of Gradle to Java

hans_d
Administrator

On Jun 27, 2008, at 4:03 PM, Detering Dirk wrote:

> Hello Hans,
>
> I read in the roadmap that Scala plugin is planned,
> but for a post 1.0 release, what is a pity in my eyes,
> as I think Scala and Gradle could benefit both from
> it regarding publicity.
> But ok, one has to prioritise, I suppose.

The roadmap is of course fluent. The problem for me with Scala that I  
have only started to read 'Programming in Scala' and have no idea how  
to design a DSL with it. I know that there are even articles on this  
topic but I just don't have the time now to get into it. But I think  
it would be very cool if Gradle supports Scala.

Basically Scala support has two aspects. One is to provide a Scala  
plugin for building Scala projects. The build script for this would  
be written in Groovy (or any other language we might support in the  
future). The other aspect is to have a Scala Script engine. See below.

>
> Regarding:
>> We will end up with only a small Groovy layer left,
>> responsible for applying the build script against the Gradle
>> objects.
> ...
>> It should be very easy then to add other build script
>> engines for any other dynamic JVM language capable of calling
>> Java code and creating Java objects (e.g. coercing a closure
>> to a Java interface).
>
> It would be interesting to find a wiki page containing
> the requirements for a JVM language to be applicable as
> build language on top of the gradle core.
>
> For example: What does 'dynamic' exactly mean in this context?
>
> Scala e.g. is a powerful language in many ways (and fast),
> though, would it match?

I have created a first draft of the wiki page: http://
docs.codehaus.org/display/GRADLE/Requirements+for+a+JVM+language+to+be
+used+for+build+scripts

How would Scala fit into this?

- Hans

>
> KR
> Det
>
>
> **********************************************************************
> *
>
> Die Information in dieser email ist vertraulich und ist  
> ausschliesslich
> fuer den/die benannten Adressaten bestimmt. Ein Zugriff auf diese
> email durch andere Personen als den/die benannten Adressaten ist
> nicht gestattet. Sollten Sie nicht der benannte Adressat sein,  
> loeschen
> Sie bitte diese email.
>
> **********************************************************************
> *
>
> BITMARCK Software GmbH
> Paul-Klinger-Strasse 15, 45127 Essen
>
> Amtsgericht Essen HRB 20680
> Geschaeftsfuehrer: Frank Krause, Andreas Prenneis
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Migrating the core of Gradle to Java

Detering Dirk-2
Hello Hans,

> Basically Scala support has two aspects. One is to provide a
> Scala plugin for building Scala projects.

I was aware of the two aspects, and my 'pity' was related
to this one.

The other aspect was only a spontaneous reaction to your
announcement reg. core and "other" script engines.

> I have created a first draft of the wiki page: http://
> docs.codehaus.org/display/GRADLE/Requirements+for+a+JVM+langua
> ge+to+be+used+for+build+scripts

Fine, thank you!

> How would Scala fit into this?

Well, to be honest, I am new to Scala too ;-) .

So the next only reflects what I understood so far.

First, Scala has an interpreter working on a binding
and compiling its literal input to a class in memory
in the same way like GroovyScriptEngine does.

What I do not see as possible is setting a delegate to
a closure and the meta-magic of methodMissing .


I think one starting point is your hint, that one could
easily write a Java build script engine.
So Scala should almost doubtless be usable.

The rest, I suppose, would be done in a way totally different
to Groovy, to achieve a DSL working on the core.

Perhaps I will find some time to check Scala especially
about this aspects.

KR
Det  


***********************************************************************

Die Information in dieser email ist vertraulich und ist ausschliesslich
fuer den/die benannten Adressaten bestimmt. Ein Zugriff auf diese
email durch andere Personen als den/die benannten Adressaten ist
nicht gestattet. Sollten Sie nicht der benannte Adressat sein, loeschen
Sie bitte diese email.

***********************************************************************

BITMARCK Software GmbH
Paul-Klinger-Strasse 15, 45127 Essen
 
Amtsgericht Essen HRB 20680
Geschaeftsfuehrer: Frank Krause, Andreas Prenneis


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Migrating the core of Gradle to Java

hans_d
Administrator
Hi Dirk,

On Jun 30, 2008, at 1:27 PM, Detering Dirk wrote:

> Hello Hans,
>
>> Basically Scala support has two aspects. One is to provide a
>> Scala plugin for building Scala projects.
>
> I was aware of the two aspects, and my 'pity' was related
> to this one.

I'm pretty sure such a plugin is very easy to write. For a person who  
knows and has used the Scala Ant tasks (I haven't) it should be a one  
day effort.

>
> The other aspect was only a spontaneous reaction to your
> announcement reg. core and "other" script engines.
>
>> I have created a first draft of the wiki page: http://
>> docs.codehaus.org/display/GRADLE/Requirements+for+a+JVM+langua
>> ge+to+be+used+for+build+scripts
>
> Fine, thank you!
>
>> How would Scala fit into this?
>
> Well, to be honest, I am new to Scala too ;-) .
>
> So the next only reflects what I understood so far.
>
> First, Scala has an interpreter working on a binding
> and compiling its literal input to a class in memory
> in the same way like GroovyScriptEngine does.
>
> What I do not see as possible is setting a delegate to
> a closure and the meta-magic of methodMissing .
>
>
> I think one starting point is your hint, that one could
> easily write a Java build script engine.
> So Scala should almost doubtless be usable.
>
> The rest, I suppose, would be done in a way totally different
> to Groovy, to achieve a DSL working on the core.
>
> Perhaps I will find some time to check Scala especially
> about this aspects.

That would be cool :)

- Hans

>
> KR
> Det
>
>
> **********************************************************************
> *
>
> Die Information in dieser email ist vertraulich und ist  
> ausschliesslich
> fuer den/die benannten Adressaten bestimmt. Ein Zugriff auf diese
> email durch andere Personen als den/die benannten Adressaten ist
> nicht gestattet. Sollten Sie nicht der benannte Adressat sein,  
> loeschen
> Sie bitte diese email.
>
> **********************************************************************
> *
>
> BITMARCK Software GmbH
> Paul-Klinger-Strasse 15, 45127 Essen
>
> Amtsgericht Essen HRB 20680
> Geschaeftsfuehrer: Frank Krause, Andreas Prenneis
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email