Scala as Javascript

125 views
Skip to first unread message

philip

unread,
Dec 25, 2010, 9:33:33 PM12/25/10
to Lift
Hi,

I noticed two projects that are interesting.

A Scala to LLVM compiler.
http://github.com/greedy/scala

A LLVM to Javascript compiler.
http://code.google.com/p/emscripten/

So you could target Javascript from Scala, like GWT.

Also noticed http://code.google.com/p/scalagwt/

Is there any use to compile Scala to Javascript in Liftweb? I mean,
could this be a useful feature later?

Phil

David Pollak

unread,
Dec 27, 2010, 1:32:45 PM12/27/10
to lif...@googlegroups.com
On Sat, Dec 25, 2010 at 6:33 PM, philip <phili...@gmail.com> wrote:
Hi,

I noticed two projects that are interesting.

A Scala to LLVM compiler.
http://github.com/greedy/scala

A LLVM to Javascript compiler.
http://code.google.com/p/emscripten/

This would be the most awkward approach I can think of.

It'd be far better to write a compiler back-end (like the MSIL back end and the LLVM back end) that will emit JavaScript.

The big problem is all the Java classes that Scala depends on... those would have to be mocked in JavaScript.

I've considered a project like this, but the effort to get something marginally useful is > 3 man months and at this point, I can't see a reason that justifies that kind of investment.
 

So you could target Javascript from Scala, like GWT.

Also noticed http://code.google.com/p/scalagwt/

Is there any use to compile Scala to Javascript in Liftweb? I mean,
could this be a useful feature later?

Phil

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Donald McLean

unread,
Dec 27, 2010, 1:44:57 PM12/27/10
to lif...@googlegroups.com
Couldn't you use the GWT library for the Java stuff?

--
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

Timothy Perrett

unread,
Dec 27, 2010, 6:25:53 PM12/27/10
to Lift
Sorry to dive in late, but someone already started a project similar
to what you outline and has made fair progress:

https://github.com/alvaroc1/s2js

It omits Javascript that is designed to then be used with the Google
closure compressor. (Disclaimer: I haven't tried this project, just
been keeping an eye on it)

Cheers, Tim

On Dec 27, 6:44 pm, Donald McLean <dmclea...@gmail.com> wrote:
> Couldn't you use the GWT library for the Java stuff?
>
> On Mon, Dec 27, 2010 at 1:32 PM, David Pollak
>
>
>
>
>
> <feeder.of.the.be...@gmail.com> wrote:
>
> > On Sat, Dec 25, 2010 at 6:33 PM, philip <philip14...@gmail.com> wrote:
>
> >> Hi,
>
> >> I noticed two projects that are interesting.
>
> >> A Scala to LLVM compiler.
> >>http://github.com/greedy/scala
>
> >> A LLVM to Javascript compiler.
> >>http://code.google.com/p/emscripten/
>
> > This would be the most awkward approach I can think of.
>
> > It'd be far better to write a compiler back-end (like the MSIL back end and
> > the LLVM back end) that will emit JavaScript.
>
> > The big problem is all the Java classes that Scala depends on... those would
> > have to be mocked in JavaScript.
>
> > I've considered a project like this, but the effort to get something
> > marginally useful is > 3 man months and at this point, I can't see a reason
> > that justifies that kind of investment.
>
> >> So you could target Javascript from Scala, like GWT.
>
> >> Also noticedhttp://code.google.com/p/scalagwt/
>
> >> Is there any use to compile Scala to Javascript in Liftweb? I mean,
> >> could this be a useful feature later?
>
> >> Phil
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Lift" group.
> >> To post to this group, send email to lif...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> liftweb+u...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages