« Return to Thread: [scala-tools] Can we improve the Eclipse REPL?

Re: [scala-tools] Can we improve the Eclipse REPL?

by Daniel Spiewak :: Rate this Message:

Reply to Author | View in Thread

IIRC, we've heard from the JavaRebel guys on this before.  Assuming that I'm remembering correctly, the answer was that bundling the Scala version of JavaRebel with the plugin would be no problem at all.  JavaRebel provides a free version for use with Scala which does allow for redistribution.  At the very least, we could bundle the javarebel.jar and force the users to point to a license in the preferences.

One issue which would need ironing is the fact that JR checks for updates on startup.  Since the JAR itself would be bundled with the plugin, we really don't want that.  I honestly have no idea if this can be disabled.

Integrating JavaRebel is really a snap.  I'm attaching my `jrscala` script which I use to launch a Scala interactive shell pre-juiced with JavaRebel.  It's worth noting that there is some flakiness to worry about.  Occaisionally, really significant changes (e.g. a series of tasks adding members, removing others, adding new classes, etc) will cause JavaRebel to get confused and somehow get stuck halfway through the change set.  In other words, you would be using a version of your classes which is not exactly current.  This would need to be made clear to anyone who uses it (particularly students).

+1 for improving the SDT REPL overall.  Even basic syntax highlighting would be extremely nice.

Daniel

On Thu, Nov 13, 2008 at 8:07 AM, Miles Sabin <miles@...> wrote:
On Thu, Nov 13, 2008 at 11:06 AM, martin odersky <martin.odersky@...> wrote:
> Ideally what I would wish for is the following:
>
>  - being able to open a REPL with a given focus. Say I open a REPL for
> element mypackage.myobject. Then I want automatic
>   imports:
>
>     import mypackage._
>     import myobject._
>
> so that I can directly access definitions in my focus and its environment.

This should be relatively straightforward to do.

>  - when I change code, the REPL should automatically re-load it. I
> think this can be achieved using JavaRebel, but don't know enough
> about it yet.
>    If we don't want to rely on JavaRebel, one could also imagine to
> re-load only if the focus file is changed. This could be done by
> wrapping the focus file in a synthetic version object, which gets
> changed everytime we edit he focus file. So we end up with many
> versions of the same class(es), each wrapped in a different version
> object.

JavaRebel works spectacularly well for this, at least with the latest
Sun JVM. My only concerns about depending on it is that it's closed
source, and it's not at all clear to me what the "free" one year Scala
license actually permits. For instance, it's not at all clear to me
whether or not it's distributable by EPFL or anyone else as a
component of the Eclipse plugin.

Ultimately it's your call on the licensing issue. From my point of
view, I would either want there to be no issues with bundling
JavaRebel with the plugin at zero cost now and into the future (ie.
well beyond one year); or have the JavaRebel functionality shipped as
an independent component separately from the rest of the Scala plugin,
in which case it would probably make sense if ZeroTurnaround could
develop and distribute it themselves.

> The current console support does neither (and, besides, it does not
> work on Windows; the console window closes immediately after being
> opened).

Yes, that's unfortunate ... I'm not sure what the problem is, and I'd
be grateful for any help anyone can give me here.

> I believe if we can do such a thing, it would be really useful. It
> would be a point where the Scala plugin would do something clearly
> better than the Java plugin. For the first time, we'd do more than
> catching up!

Agreed!

Cheers,


Miles

--
Miles Sabin
tel:    +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype:  milessabin



jrscala (1K) Download Attachment

 « Return to Thread: [scala-tools] Can we improve the Eclipse REPL?