- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
further thoughts on Scala to Java: Scala to C#
Sun, 2010-01-10, 16:30
While reading this list today I realized that, provided one dumbs-down the
ASTs to leave only Java-amenable nodes, it wouldn't take much additional
effort to replace the last phase in the proposed two-phase translation
(serialization into .java files) with another that serializes into .cs
files.
Think about it, piggybacking on the C# compiler, for fun and profit.
Besides, it should be easier to reason about translation correctness in
terms of constructs of "Scala--" (as per previous post), Java, and C#,
rather than in terms of ... a deeper translation pipeline all the way to VM
code.
I'm telling you this to entice all the .NET lovers to contribute some
thinking time to the TO-DO list of issues around the translations
Scala -> "boring" ASTs -> Java
(as per previous posts). There are sub-tasks aplenty!
Sun, 2010-01-10, 18:37
#2
Re: further thoughts on Scala to Java: Scala to C#
Thats an interesting proposal. ;-)
On Jan 10, 2010 5:52 PM, "Daniel Sobral" <dcsobral@gmail.com> wrote:
For real fun and profit, generate Objective C, please. :-)On Sun, Jan 10, 2010 at 1:29 PM, Miguel Garcia <miguel.garcia@tuhh.de> wrote: > > > While reading ...
--
Daniel C. Sobral
I travel to the future all the time.
Sun, 2010-01-10, 18:47
#3
Re: further thoughts on Scala to Java: Scala to C#
Ahh, the lucrative iPhone market, now that would be interesting...
2010/1/10 Viktor Klang <viktor.klang@gmail.com>
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
2010/1/10 Viktor Klang <viktor.klang@gmail.com>
Thats an interesting proposal. ;-)
On Jan 10, 2010 5:52 PM, "Daniel Sobral" <dcsobral@gmail.com> wrote:
For real fun and profit, generate Objective C, please. :-)On Sun, Jan 10, 2010 at 1:29 PM, Miguel Garcia <miguel.garcia@tuhh.de> wrote: > > > While reading ...
--
Daniel C. Sobral
I travel to the future all the time.
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sun, 2010-01-10, 19:07
#4
Re: further thoughts on Scala to Java: Scala to C#
Even though the SDK for Objective-C sports tooling for static analysis
[1], no, I won't jump on that bandwagon.
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia/
[1]
http://developer.apple.com/iphone/library/documentation/DeveloperTools/C...
Sun, 2010-01-10, 21:47
#5
Re: further thoughts on Scala to Java: Scala to C#
What about generating Javascript?
--j
On Sun, Jan 10, 2010 at 7:29 AM, Miguel Garcia <miguel.garcia@tuhh.de> wrote:
--j
On Sun, Jan 10, 2010 at 7:29 AM, Miguel Garcia <miguel.garcia@tuhh.de> wrote:
While reading this list today I realized that, provided one dumbs-down the ASTs to leave only Java-amenable nodes, it wouldn't take much additional effort to replace the last phase in the proposed two-phase translation (serialization into .java files) with another that serializes into .cs files.
Think about it, piggybacking on the C# compiler, for fun and profit.
Besides, it should be easier to reason about translation correctness in terms of constructs of "Scala--" (as per previous post), Java, and C#, rather than in terms of ... a deeper translation pipeline all the way to VM code.
I'm telling you this to entice all the .NET lovers to contribute some thinking time to the TO-DO list of issues around the translations
Scala -> "boring" ASTs -> Java
(as per previous posts). There are sub-tasks aplenty!
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia
Sun, 2010-01-10, 22:07
#6
Re: further thoughts on Scala to Java: Scala to C#
> What about generating Javascript?
I guess the best design is first to get the Scala -> Java translation right,
and then hope for
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompati...
to do its best.
Sun, 2010-01-10, 22:27
#7
Re: further thoughts on Scala to Java: Scala to C#
Somebody has to ask it... but what about openCL ?
2010/1/10 Miguel Garcia <miguel.garcia@tuhh.de>
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
2010/1/10 Miguel Garcia <miguel.garcia@tuhh.de>
What about generating Javascript?
I guess the best design is first to get the Scala -> Java translation right, and then hope for
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html
to do its best.
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Mon, 2010-01-11, 11:37
#8
Re: further thoughts on Scala to Java: Scala to C#
Kevin,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I don’t think we can even start considering target languages other than Java or C#, not until a better understanding is gained about the ASTs shapes arriving at the compiler backend (as delivered by cleanup).
For example, does object Java initialization semantics suffice or can it be expressed only in bytecode? Which phases would need retouching to avoid forward-jumps showing up? [1] Having the compiler print out trees in an IDE-consumable [2] manner would help in seeing this.
I don’t see any shorter path than this. Want to contribute a write-up with prototype?
Miguel
[1] http://www.sable.mcgill.ca/publications/papers/#505050-2
[2] http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/ScalaM...
----- Original Message ----- From: Ye1E23mwN+BqQ9rBEUg [at] public [dot] gmane [dot] org" href="mailto:kev.lee.wright-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" rel="nofollow">Kevin Wright Newsgroups: gmane.comp.lang.scala.internals To: Miguel Garcia Cc: scala-internals-soYaJrOCGFRsFbksJNLsAg@public.gmane.org Sent: Sunday, January 10, 2010 10:21 PM Subject: Re: further thoughts on Scala to Java: Scala to C#
Somebody has to ask it... but what about openCL ?
2010/1/10 Miguel Garcia <miguel.garcia-eQQDT5lksu8@public.gmane.org>
What about generating Javascript?
I guess the best design is first to get the Scala -> Java translation right, and then hope for
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html
to do its best.
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia
--
Kevin Wright
mail/google talk: Ye1E23mwN+BqQ9rBEUg [at] public [dot] gmane [dot] org" rel="nofollow">kev.lee.wright-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
wave: kev.lee.wright-dIqNPqS81yMXQ3Lr6voeyA@public.gmane.org
skype: kev.lee.wright
twitter: @thecoda
Mon, 2010-01-11, 11:47
#9
Re: Re: further thoughts on Scala to Java: Scala to C#
If I'm realistic, I don't see any reasonable way to narrow down scala semantics to something as focussed as OpenCL.More likely, this is a possible optimisation that can be made in the JVM, perhaps something coming out of the parallel array work.
Still, all that lovely parallelism would be wonderful to get at somehow :)
2010/1/11 Miguel Garcia <miguel.garcia@tuhh.de>
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Still, all that lovely parallelism would be wonderful to get at somehow :)
2010/1/11 Miguel Garcia <miguel.garcia@tuhh.de>
Kevin,
I don’t think we can even start considering target languages other than Java or C#, not until a better understanding is gained about the ASTs shapes arriving at the compiler backend (as delivered by cleanup).
For example, does object Java initialization semantics suffice or can it be expressed only in bytecode? Which phases would need retouching to avoid forward-jumps showing up? [1] Having the compiler print out trees in an IDE-consumable [2] manner would help in seeing this.
I don’t see any shorter path than this. Want to contribute a write-up with prototype?
Miguel
[1] http://www.sable.mcgill.ca/publications/papers/#505050-2
[2] http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/ScalaMinusMinus.pdf
----- Original Message ----- From: Ye1E23mwN+BqQ9rBEUg [at] public [dot] gmane [dot] org" href="mailto:kev.lee.wright-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" target="_blank" rel="nofollow">Kevin Wright Newsgroups: gmane.comp.lang.scala.internals To: Miguel Garcia Cc: scala-internals-soYaJrOCGFRsFbksJNLsAg@public.gmane.org Sent: Sunday, January 10, 2010 10:21 PM Subject: Re: further thoughts on Scala to Java: Scala to C#
Somebody has to ask it... but what about openCL ?
2010/1/10 Miguel Garcia <miguel.garcia-eQQDT5lksu8@public.gmane.org>
What about generating Javascript?
I guess the best design is first to get the Scala -> Java translation right, and then hope for
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html
to do its best.
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia
--
Kevin Wright
mail/google talk: Ye1E23mwN+BqQ9rBEUg [at] public [dot] gmane [dot] org" target="_blank" rel="nofollow">kev.lee.wright-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
wave: kev.lee.wright-dIqNPqS81yMXQ3Lr6voeyA@public.gmane.org
skype: kev.lee.wright
twitter: @thecoda
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Mon, 2010-01-11, 18:27
#10
Re: further thoughts on Scala to Java: Scala to C#
Jorge Ortiz wrote:
> What about generating Javascript?
I've been toying with a compiler that translates bytecode to JavaScript
for a few hours since last weekend. I doubt it will ever be more than a
toy because of the impedance mismatch between the JVM and JavaScript but
OTOH GWT suffers from them just the same and is still considered useful :)
-sz
Mon, 2010-01-11, 19:07
#11
Re: further thoughts on Scala to Java: Scala to C#
This is why I'm dubious about a Scala -> Java -> GWT translation. A lot is lost in a Scala -> Java translation that wouldn't be lost in a direct Scala -> Javascript translation.
--j
On Mon, Jan 11, 2010 at 9:23 AM, Stefan Zeiger <szeiger@novocode.com> wrote:
--j
On Mon, Jan 11, 2010 at 9:23 AM, Stefan Zeiger <szeiger@novocode.com> wrote:
Jorge Ortiz wrote:
> What about generating Javascript?
I've been toying with a compiler that translates bytecode to JavaScript
for a few hours since last weekend. I doubt it will ever be more than a
toy because of the impedance mismatch between the JVM and JavaScript but
OTOH GWT suffers from them just the same and is still considered useful :)
-sz
Mon, 2010-01-11, 19:17
#12
Re: further thoughts on Scala to Java: Scala to C#
On Mon, Jan 11, 2010 at 09:57:32AM -0800, Jorge Ortiz wrote:
> This is why I'm dubious about a Scala -> Java -> GWT translation. A
> lot is lost in a Scala -> Java translation that wouldn't be lost in a
> direct Scala -> Javascript translation.
My dubiousness exceeds even your considerable dubiousness. I can
envision a surprisingly sane direct translation. Going by way of java
will turn out like those translation jokes where after going english to
russian to english you go from "the spirit is weak but the flesh is
willing" to "the wine sucks and the meat is rotten." Except with more
comical corner case failures. (Can you call them corner cases when
there are nothing but corners?)
Mon, 2010-01-11, 19:37
#13
Re: further thoughts on Scala to Java: Scala to C#
> A lot is lost in a Scala -> Java
translation that wouldn't be lost
> in a direct Scala -> Javascript translation There you go with two shattering statements that I can't prove scientifically wrong.
On the other hand, I don't believe you can prove them scientifically sound either ;-)
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner
> in a direct Scala -> Javascript translation There you go with two shattering statements that I can't prove scientifically wrong.
On the other hand, I don't believe you can prove them scientifically sound either ;-)
Miguel
http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner
----- Original Message ----- From: jorge [dot] ortiz [at] gmail [dot] com" href="mailto:jorge.ortiz@gmail.com" rel="nofollow">Jorge Ortiz To: Stefan Zeiger Cc: scala-internals@listes.epfl.ch Sent: Monday, January 11, 2010 6:57 PM Subject: Re: [scala-internals] further thoughts on Scala to Java: Scala to C#
This is why I'm dubious about a Scala -> Java -> GWT translation. A lot is lost in a Scala -> Java translation that wouldn't be lost in a direct Scala -> Javascript translation.
--j
On Mon, Jan 11, 2010 at 9:23 AM, Stefan Zeiger <szeiger@novocode.com> wrote:
Jorge Ortiz wrote:
> What about generating Javascript?
I've been toying with a compiler that translates bytecode to JavaScript
for a few hours since last weekend. I doubt it will ever be more than a
toy because of the impedance mismatch between the JVM and JavaScript but
OTOH GWT suffers from them just the same and is still considered useful :)
-sz
On Sun, Jan 10, 2010 at 1:29 PM, Miguel Garcia <miguel.garcia@tuhh.de> wrote:
--
Daniel C. Sobral
I travel to the future all the time.