This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Run scala script without installing scala?

1 reply
jlist9
Joined: 2009-09-29,
User offline. Last seen 42 years 45 weeks ago.

Hi,

I have a simple scala script. Is it possible, with JRE and
scala-library.jar, to execute
the script without installing scala, and without compiling the script?

Thanks

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Run scala script without installing scala?

On Fri, Mar 05, 2010 at 11:43:17AM -0800, jlist9 wrote:
> I have a simple scala script. Is it possible, with JRE and
> scala-library.jar, to execute the script without installing scala, and
> without compiling the script?

Nothing presently on this earth can execute it without compiling it.
The so-called "interpreter" is really a "quietly compile and run"-er.
However if we ignore that condition, sure. The code which does so will
include a line something like

new java.net.URL("http://www.simplyscala.com/interp?" + code)

and there you have it. You don't even need scala-library.jar!

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland