This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Groovy++ interoperability with Scala

7 replies
Alex Tkachman
Joined: 2011-05-29,
User offline. Last seen 42 years 45 weeks ago.

Hi everybody!

I would like to consider technical possibility of making scala traits
bi-directionally binary compatible/interoperable with Groovy++ traits.
Meaning traits created by one language can be used by another one. Any
hints for documentation on binary representation of traits in scala?
Anybody around interested to help?

Best regards
Alex

daniel
Joined: 2008-08-20,
User offline. Last seen 44 weeks 15 hours ago.
Re: Groovy++ interoperability with Scala
This might help you.  http://www.codecommit.com/blog/java/interop-between-java-and-scala  It's an older article, but I'm pretty sure all of the information is still correct.

Daniel

On Sat, May 28, 2011 at 11:52 PM, Alex Tkachman <alex.tkachman@gmail.com> wrote:
Hi everybody!

I would like to consider technical possibility of making scala traits
bi-directionally binary compatible/interoperable with Groovy++ traits.
Meaning traits created by one language can be used by another one. Any
hints for documentation on binary representation of traits in scala?
Anybody around interested to help?

Best regards
Alex

Alex Tkachman
Joined: 2011-05-29,
User offline. Last seen 42 years 45 weeks ago.
Re: Groovy++ interoperability with Scala

Thank you, Daniel!
Any hints on compilation super in traits? On constructors naming? On fields?

On Sun, May 29, 2011 at 7:39 PM, Daniel Spiewak wrote:
> This might help you.
> http://www.codecommit.com/blog/java/interop-between-java-and-scala  It's an
> older article, but I'm pretty sure all of the information is still correct.
>
> Daniel
>
> On Sat, May 28, 2011 at 11:52 PM, Alex Tkachman
> wrote:
>>
>> Hi everybody!
>>
>> I would like to consider technical possibility of making scala traits
>> bi-directionally binary compatible/interoperable with Groovy++ traits.
>> Meaning traits created by one language can be used by another one. Any
>> hints for documentation on binary representation of traits in scala?
>> Anybody around interested to help?
>>
>> Best regards
>> Alex
>

Miguel Garcia 2
Joined: 2011-01-30,
User offline. Last seen 42 years 45 weeks ago.
Aw: Groovy++ interoperability with Scala

Alex,

Several compiler phases take part in mixing traits into ASTs: super
accessors are added in superaccessors, trait initializers are there by the
time explicitouter runs, erasure [1] adds invocations to those initializers
in primary constructors of classes mixing those traits, and of course mixin
finishes up this multi-step transformation.

Actually, mixin is one of the phases not yet covered at The Scala Compiler
Corner [2]. Contributions are welcome!


Miguel
http://lamp.epfl.ch/~magarcia/ScalaNET/


[1]
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2011Q2/HowErasureWorksPartA.pdf

[2] http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/


Alex Tkachman
Joined: 2011-05-29,
User offline. Last seen 42 years 45 weeks ago.
Re: Aw: Groovy++ interoperability with Scala

Well, I am afraid I am too far from Scala not only to contribute
anything but even to read scala code :)

What I am looking for is formal description of naming scheme, so we
can use exactly the same in Groovy++ compiler. In fact it will be
stupid if we did opposite only because we don't know yours scheme. I
am also a bit worried that if the scheme is not documented it can be
changed any moment without any notice and to break binary
compatibility we would like to achieve

On Mon, May 30, 2011 at 8:13 AM, Miguel Garcia wrote:
>
> Alex,
>
> Several compiler phases take part in mixing traits into ASTs: super
> accessors are added in superaccessors, trait initializers are there by the
> time explicitouter runs, erasure [1] adds invocations to those initializers
> in primary constructors of classes mixing those traits, and of course mixin
> finishes up this multi-step transformation.
>
> Actually, mixin is one of the phases not yet covered at The Scala Compiler
> Corner [2]. Contributions are welcome!
>
>
> Miguel
> http://lamp.epfl.ch/~magarcia/ScalaNET/
>
>
> [1]
> http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2011Q2/HowEras...
>
> [2] http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
>
>
>

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Aw: Groovy++ interoperability with Scala

This might require a bit more effort than naming conventions....

Specifically, scala uses annotations to store scala signatures...  This means groovy would have to generate those!

On May 30, 2011 4:25 AM, "Alex Tkachman" <alex.tkachman@gmail.com> wrote:
> Well, I am afraid I am too far from Scala not only to contribute
> anything but even to read scala code :)
>
> What I am looking for is formal description of naming scheme, so we
> can use exactly the same in Groovy++ compiler. In fact it will be
> stupid if we did opposite only because we don't know yours scheme. I
> am also a bit worried that if the scheme is not documented it can be
> changed any moment without any notice and to break binary
> compatibility we would like to achieve
>
> On Mon, May 30, 2011 at 8:13 AM, Miguel Garcia <mgarcia512@yahoo.com> wrote:
>>
>> Alex,
>>
>> Several compiler phases take part in mixing traits into ASTs: super
>> accessors are added in superaccessors, trait initializers are there by the
>> time explicitouter runs, erasure [1] adds invocations to those initializers
>> in primary constructors of classes mixing those traits, and of course mixin
>> finishes up this multi-step transformation.
>>
>> Actually, mixin is one of the phases not yet covered at The Scala Compiler
>> Corner [2]. Contributions are welcome!
>>
>>
>> Miguel
>> http://lamp.epfl.ch/~magarcia/ScalaNET/
>>
>>
>> [1]
>> http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2011Q2/HowErasureWorksPartA.pdf
>>
>> [2] http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
>>
>>
>>
Vladimir Kirichenko
Joined: 2009-02-19,
User offline. Last seen 42 years 45 weeks ago.
Re: Aw: Groovy++ interoperability with Scala

Josh Suereth wrote:
> This might require a bit more effort than naming conventions....
>
> Specifically, scala uses annotations to store scala signatures... This
> means groovy would have to generate those!

I'm afraid they have one:

http://groovy.codehaus.org/Scalify

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Aw: Groovy++ interoperability with Scala

check the details.  it does not generate the @ScalaSig annotation required for full scala interoperability.   see the note about scala sig classfile attribute.

On May 30, 2011 5:36 PM, "Volodymyr Kyrychenko" <vladimir.kirichenko@gmail.com> wrote:
> Josh Suereth wrote:
>> This might require a bit more effort than naming conventions....
>>
>> Specifically, scala uses annotations to store scala signatures... This
>> means groovy would have to generate those!
>
> I'm afraid they have one:
>
> http://groovy.codehaus.org/Scalify
>
>
>
> --
> Best Regards,
> Volodymyr Kyrychenko

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland