Scala

105 views
Skip to first unread message

codditor

unread,
Aug 13, 2009, 8:52:44 PM8/13/09
to robocode-developers
Hello!

Is it possible to use Scala (or other jvm language) for programming
robots? I think there was a problem with the classpath but i am not
sure...

Thank you,
George.

Nat Pavasant

unread,
Aug 14, 2009, 5:06:41 AM8/14/09
to robocode-...@googlegroups.com
Hi George,

I don't know if it is able to do that now, but I know that the Scala
language plug-in is in development. The release date is unknown at the
moment, but it is developing.

Best,
- Nat

2009/8/14 codditor <codd...@gmail.com>:

Maciej Hrynczyszyn

unread,
Aug 14, 2009, 5:19:53 AM8/14/09
to robocode-...@googlegroups.com
2009/8/14 Nat Pavasant <nat...@gmail.com>:

> I don't know if it is able to do that now,

Last time i checked (which was about a year ago) it was. You just had
to include scala runtime in the classpath and release some checks on
the packages loaded in robocode security manager.

M,

Alex Schultz

unread,
Aug 14, 2009, 8:36:16 AM8/14/09
to robocode-...@googlegroups.com

Hey George,

I have not tested this myself, but I've also been considering using
Scala for a Robocode bot. I don't know for certain, but I suspect the
procedure here:
http://jim-mcbeath.blogspot.com/2008/08/stringart-scala-applet.html#scalalib
which explains how to use scala in an applet (and only including the
necessary parts of the scala library in the final jar), would very
likely work. The only difference is you would need to merge the
compacted Scala jar into your robot's jar, instead of leaving it
separate. Keep in mind, I have not tested this, but I suspect it would
work.

Alex

Pavel Šavara

unread,
Aug 14, 2009, 3:43:58 PM8/14/09
to robocode-...@googlegroups.com
> I don't know if it is able to do that now, but I know that the Scala
> language plug-in is in development. The release date is unknown at the
> moment, but it is developing.

Hi George, All,

that's right.

1) You could disable security and add scala to classpath or robocode
and it should work.
I do not encourgage you to do that. And ask you to not promote that
idea, because it's unsecure to beginner users and general public.

2) We have scala language support in development.
Actually we have working prototype.
https://robocode.svn.sourceforge.net/svnroot/robocode/robocode/trunk/plugins/scala/
It's plugin which could be built by maven and deployed into
robocode/lib directory.
Game engine will pick it up automatically and from that pint on scala
robots are first class members.

Benefit of such approach is better control over security and small
size of robot itself.

So why we don't offer it for download as standard plugin yet ?
Several reasons.

- it's not well tested at all
- support for more languages is still pending. JavaScript and .NET are drafted.
- internal extensibility APIs are not 100% stable yet.
- there are two posibilities how to integrate scala
- inside security sandboxwith robot. That could kill some features
of language which use reflection, classloaders or dynamic classes
- outside the sandbox, as part of trusted code. But the we expose
all robocode users to security problems of scala runtime, if there are
some. I'm not sure if scala was designed with malicious scala code in
mind.
- I did no research of that topic yet
- I'm no scala expert and noone offered me helping hand yet
- we need create demo scala robot which uses/shows scala language features
- we need create testing robots which will use scala features
including bleeding edge to test security and functionality of scala in
restricted environment.

I would welcome anyone who could pickup that research and contribute solution.
I'm keen to offer my support to such person after I realize that he is
able to make real progress.
I think that amount of work is doable as semester work. Or couple of
hours for experienced scala geek.

Same is valid for JavaScript or Rhino, Jython or JRuby or whatever language.
Those dynamic languages are bit more dificult, because we need to
detect robot type before it runs.

For .NET languages I work hard to deliver it. My current estimate is
2-3 months. I already have all technological components implemented
and putting it together.


Thanks
Pavel

Reply all
Reply to author
Forward
0 new messages