- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Groovy++ interoperability with Scala
Sun, 2011-05-29, 05:52
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
Mon, 2011-05-30, 07:37
#2
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
>
Mon, 2011-05-30, 09:17
#3
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/
Mon, 2011-05-30, 09:27
#4
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/
>
>
>
Mon, 2011-05-30, 12:17
#5
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/
>>
>>
>>
Mon, 2011-05-30, 22:37
#6
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:
Tue, 2011-05-31, 01:47
#7
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
Daniel
On Sat, May 28, 2011 at 11:52 PM, Alex Tkachman <alex.tkachman@gmail.com> wrote: