<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Interop Between Java and Scala</title>
	<atom:link href="http://www.codecommit.com/blog/java/interop-between-java-and-scala/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:01:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jmalcolm</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-5116</link>
		<dc:creator>jmalcolm</dc:creator>
		<pubDate>Tue, 27 Jul 2010 18:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-5116</guid>
		<description>Daniel, thank you for all the Scala content.  It is very, very useful for a C# refugee like me.  My interest in Scala may yet drag me to the Java platform.

This post just makes me wish that we had a real Scala implementation on .NET/Mono.  In a lot of ways, Scala seems like a better fit for the CLR than it does for the JVM.

Method definitions in traits would map well to extension methods on interfaces in .NET.  You could translate trait methods right back to C# code and never know it was not natively written.  No need for &#039;$&#039; in the names.  Tools like Visual Studio would show the extension methods as valid methods for any classes deriving from the interface.  Very seamless.

It is great that Scala generics are Java generics but both are smoke and mirrors at the JVM level.  The CLR supports generics natively at the bytecode level.

Properties are native to the CLR as well so they translate naturally from Scala.  Of course, getters and setters seem just as natural in Java.

Of course, operator overloading is allowed on the CLR so you would not need as much of this brilliant but still somewhat ugly operator to alphabetical name translation stuff.

Having interoperability in reverse would be the real treat.  It would be great to see my C# interfaces and extension methods map to nice clean Scala traits for example.

My point is not to slam the JVM.  It is the real-use in the real world leader after all.  Rather, I am simply expressing my Scala envy and thinking out loud what a great language it would be on .NET/Mono.

There is a real overlap in capability between C# and Scala (even the mix of OO and functional) but Scala takes it a little further and seems to suit me better.

Maybe someday Martin will reward me (he threatens to sometimes).

Thanks for the great content.</description>
		<content:encoded><![CDATA[<p>Daniel, thank you for all the Scala content.  It is very, very useful for a C# refugee like me.  My interest in Scala may yet drag me to the Java platform.</p>
<p>This post just makes me wish that we had a real Scala implementation on .NET/Mono.  In a lot of ways, Scala seems like a better fit for the CLR than it does for the JVM.</p>
<p>Method definitions in traits would map well to extension methods on interfaces in .NET.  You could translate trait methods right back to C# code and never know it was not natively written.  No need for &#8216;$&#8217; in the names.  Tools like Visual Studio would show the extension methods as valid methods for any classes deriving from the interface.  Very seamless.</p>
<p>It is great that Scala generics are Java generics but both are smoke and mirrors at the JVM level.  The CLR supports generics natively at the bytecode level.</p>
<p>Properties are native to the CLR as well so they translate naturally from Scala.  Of course, getters and setters seem just as natural in Java.</p>
<p>Of course, operator overloading is allowed on the CLR so you would not need as much of this brilliant but still somewhat ugly operator to alphabetical name translation stuff.</p>
<p>Having interoperability in reverse would be the real treat.  It would be great to see my C# interfaces and extension methods map to nice clean Scala traits for example.</p>
<p>My point is not to slam the JVM.  It is the real-use in the real world leader after all.  Rather, I am simply expressing my Scala envy and thinking out loud what a great language it would be on .NET/Mono.</p>
<p>There is a real overlap in capability between C# and Scala (even the mix of OO and functional) but Scala takes it a little further and seems to suit me better.</p>
<p>Maybe someday Martin will reward me (he threatens to sometimes).</p>
<p>Thanks for the great content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jiang</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4912</link>
		<dc:creator>Jiang</dc:creator>
		<pubDate>Thu, 03 Dec 2009 07:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4912</guid>
		<description>Hi sir,

How to implement the scala List with Java code?
Such as:
def archs (e:Edge) : List[Point] = Nil

How can I transfer it to java code?</description>
		<content:encoded><![CDATA[<p>Hi sir,</p>
<p>How to implement the scala List with Java code?<br />
Such as:<br />
def archs (e:Edge) : List[Point] = Nil</p>
<p>How can I transfer it to java code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4835</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Sat, 25 Apr 2009 16:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4835</guid>
		<description>I think a lot of us need the more basic questions answered, such as how do you compile the two languages together? How do we change an existing (eclipse) ant build.xml to include scala classes? If we have an existing Java project, is there a quick scala script or skeleton we can adapt to call our classes and see if there are compatibility problems? Advice, such as &quot;If you see this error, then you have a compatibility problem&quot; vs &quot;If you see this error, then you just haven&#039;t laid out your file tree correctly&quot;.</description>
		<content:encoded><![CDATA[<p>I think a lot of us need the more basic questions answered, such as how do you compile the two languages together? How do we change an existing (eclipse) ant build.xml to include scala classes? If we have an existing Java project, is there a quick scala script or skeleton we can adapt to call our classes and see if there are compatibility problems? Advice, such as &#8220;If you see this error, then you have a compatibility problem&#8221; vs &#8220;If you see this error, then you just haven&#8217;t laid out your file tree correctly&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Phillips</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4823</link>
		<dc:creator>Paul Phillips</dc:creator>
		<pubDate>Sun, 12 Apr 2009 13:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4823</guid>
		<description>Martin suppressed $tag methods in pure interfaces about a year ago:

  https://lampsvn.epfl.ch/trac/scala/ticket/722

I got rid of $tag entirely a couple months ago.</description>
		<content:encoded><![CDATA[<p>Martin suppressed $tag methods in pure interfaces about a year ago:</p>
<p>  <a href="https://lampsvn.epfl.ch/trac/scala/ticket/722" rel="nofollow">https://lampsvn.epfl.ch/trac/scala/ticket/722</a></p>
<p>I got rid of $tag entirely a couple months ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4793</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Sun, 22 Mar 2009 20:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4793</guid>
		<description>@Dean

You&#039;re quite right:

&lt;pre&gt;daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar scala.Function1$class
Compiled from &quot;Function1.scala&quot;
public interface scala.Function1 extends scala.ScalaObject{
    public abstract scala.Function1 andThen(scala.Function1);
    public abstract scala.Function1 compose(scala.Function1);
    public abstract java.lang.String toString();
    public abstract java.lang.Object apply(java.lang.Object);
}

daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar scala.ScalaObject
Compiled from &quot;ScalaObject.scala&quot;
public interface scala.ScalaObject{
    public abstract int $tag()       throws java.rmi.RemoteException;
}

daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar &#039;scala.Function1$class&#039;
Compiled from &quot;Function1.scala&quot;
public abstract class scala.Function1$class extends java.lang.Object{
    public static void $init$(scala.Function1);
    public static scala.Function1 andThen(scala.Function1, scala.Function1);
    public static scala.Function1 compose(scala.Function1, scala.Function1);
    public static java.lang.String toString(scala.Function1);
}&lt;/pre&gt;

I didn&#039;t actually try to compile any of my examples in the comments, which would explain how I missed this.  As a general work-around, you can probably just return 0 from $tag and I don&#039;t think that it will cause too many problems.  Alternatively, you can compile a real function value in Scala, decompile it and then look at the bytecode source for $tag, see what Scala does in this case.</description>
		<content:encoded><![CDATA[<p>@Dean</p>
<p>You&#8217;re quite right:</p>
<pre>daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar scala.Function1$class
Compiled from "Function1.scala"
public interface scala.Function1 extends scala.ScalaObject{
    public abstract scala.Function1 andThen(scala.Function1);
    public abstract scala.Function1 compose(scala.Function1);
    public abstract java.lang.String toString();
    public abstract java.lang.Object apply(java.lang.Object);
}

daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar scala.ScalaObject
Compiled from "ScalaObject.scala"
public interface scala.ScalaObject{
    public abstract int $tag()       throws java.rmi.RemoteException;
}

daniel@lal ~ $ javap -classpath /usr/local/scala-2.7.3.final/lib/scala-library.jar 'scala.Function1$class'
Compiled from "Function1.scala"
public abstract class scala.Function1$class extends java.lang.Object{
    public static void $init$(scala.Function1);
    public static scala.Function1 andThen(scala.Function1, scala.Function1);
    public static scala.Function1 compose(scala.Function1, scala.Function1);
    public static java.lang.String toString(scala.Function1);
}</pre>
<p>I didn&#8217;t actually try to compile any of my examples in the comments, which would explain how I missed this.  As a general work-around, you can probably just return 0 from $tag and I don&#8217;t think that it will cause too many problems.  Alternatively, you can compile a real function value in Scala, decompile it and then look at the bytecode source for $tag, see what Scala does in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Wampler</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4792</link>
		<dc:creator>Dean Wampler</dc:creator>
		<pubDate>Sun, 22 Mar 2009 20:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4792</guid>
		<description>It looks like the &#039;FunctionN$class.$tag&#039; methods aren&#039;t defined in v2.7.1 through v2.7.3. They don&#039;t show up using javap and Java code like the examples above in the comments don&#039;t compile. Are the examples based on earlier Scala versions?</description>
		<content:encoded><![CDATA[<p>It looks like the &#8216;FunctionN$class.$tag&#8217; methods aren&#8217;t defined in v2.7.1 through v2.7.3. They don&#8217;t show up using javap and Java code like the examples above in the comments don&#8217;t compile. Are the examples based on earlier Scala versions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antony Stubbs</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4728</link>
		<dc:creator>Antony Stubbs</dc:creator>
		<pubDate>Sat, 21 Feb 2009 01:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4728</guid>
		<description>Unfortunately though, lists aren&#039;t lists:
http://stubbisms.wordpress.com/2009/02/18/fighting-scala-scala-to-java-list-conversion/</description>
		<content:encoded><![CDATA[<p>Unfortunately though, lists aren&#8217;t lists:<br />
<a href="http://stubbisms.wordpress.com/2009/02/18/fighting-scala-scala-to-java-list-conversion/" rel="nofollow">http://stubbisms.wordpress.com/2009/02/18/fighting-scala-scala-to-java-list-conversion/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4721</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Mon, 16 Feb 2009 15:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4721</guid>
		<description>@prithvi

* Syntax (much more concise than Java)
* Function values (sometimes called &quot;closures&quot;)
* Concise immutability
* Symbolic methods (operator overloading)
* No statics (pure object-orientation)
* A type system which actually works
* Sane generics

I could go on and on, but those are the biggies.</description>
		<content:encoded><![CDATA[<p>@prithvi</p>
<p>* Syntax (much more concise than Java)<br />
* Function values (sometimes called &#8220;closures&#8221;)<br />
* Concise immutability<br />
* Symbolic methods (operator overloading)<br />
* No statics (pure object-orientation)<br />
* A type system which actually works<br />
* Sane generics</p>
<p>I could go on and on, but those are the biggies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prithvi</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4720</link>
		<dc:creator>prithvi</dc:creator>
		<pubDate>Sun, 15 Feb 2009 08:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4720</guid>
		<description>may i know in wat all possible ways scala is advantageous over java?</description>
		<content:encoded><![CDATA[<p>may i know in wat all possible ways scala is advantageous over java?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Haberman</title>
		<link>http://www.codecommit.com/blog/java/interop-between-java-and-scala/comment-page-1#comment-4719</link>
		<dc:creator>Stephen Haberman</dc:creator>
		<pubDate>Sat, 14 Feb 2009 04:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/interop-between-java-and-scala#comment-4719</guid>
		<description>Excellent post.

I&#039;m not a fan of the dynamic language trend where all of the magic is done at runtime and nothing maps to real method calls, just lots of metaclass lookup.

Scala doing magic at compile time and then mapping to regular Java constructs under the hood is a welcome change.

I&#039;m currently pining for a language with the same compile-time, &quot;still Java&quot; magic of Scala, but a bit simpler. boojay is really close, I think, but needs to mature beyond a cool hack.</description>
		<content:encoded><![CDATA[<p>Excellent post.</p>
<p>I&#8217;m not a fan of the dynamic language trend where all of the magic is done at runtime and nothing maps to real method calls, just lots of metaclass lookup.</p>
<p>Scala doing magic at compile time and then mapping to regular Java constructs under the hood is a welcome change.</p>
<p>I&#8217;m currently pining for a language with the same compile-time, &#8220;still Java&#8221; magic of Scala, but a bit simpler. boojay is really close, I think, but needs to mature beyond a cool hack.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
