Talk:Other JVM Languages

From Robowiki
Revision as of 13:10, 26 January 2010 by Nat (talk | contribs) (→‎Robocode in Other Languages: what actually is 'helping with Scala implementation')
Jump to navigation Jump to search

Non-.class languages

"Support for languages which don't have a compiler will require changes to Robocode which nobody has yet volunteered to implement." I don't think this is entirely correct. Pavel has been hard at work adding support for .NET to Robocode, which I believe would add support for some other languages. Someone who knows more about it should add a note about that, though. --Voidious 16:22, 24 January 2010 (UTC)

I haven't been following his work on that front, but if his work is concentrated on loading .NET assemblies, then the comment is still valid. For non-compiled languages, you would still need some custom code for each language to load the interpreter and parse each source file to find classes which extend Robot.--Duyn 02:35, 25 January 2010 (UTC)

No, basic Scala has already been implemented, as I write below. Sorry =) --Nat Pavasant 10:35, 25 January 2010 (UTC)

Robocode in Other Languages

I don't believe this page is good idea. From what I heard, many features of Scala require feature that is blocked by Robocode's Sandbox. Pavel has implemented a basic Scala Robot already (see /plugins folder in Robocode's source), but some feature of Scala require Reflection, which is blocked by Robocode's Sandbox. So he is in need of Scala wizard who can help him done this. He said that if he done this himself, it may take months, but a scala wizard could have done this in just a couple of hours. I don't know abotu Clojure, but we already have plan for Ruby (via JRuby), Python (via Jython), PHP, and Javascript (Rhino Engine).

  • .NET Robocode is almost completed. I was just reqested by Pavel to do QA on it. It should be beta release soon. For those who is interested in, Pavel has created jni4net library that connect .NET CLR and JVM through JNI. Earlier he code it just for Robocode, but he and Fnl decided to separated the project for other to use it too.
  • Javascript via Rhino Engine has already been basically implemented too, but the fact the Jacascript is not really powerful, it hasn't been mentioned much.
  • I've requested PHP for Robocode too. Take a time search, PHP-Java bridge seems to do well.
  • Python and Ruby can be implemented via Jython and JRuby, but nothing has done yet.

Note that people have tried to use Python for Robocode before too, but experience problem. And those robot cannot run in Competition until it make official. --Nat Pavasant 10:35, 25 January 2010 (UTC)

  1. I think the information is useful even if people can't enter their robots into any official leagues. Robocode gives a nice practical way to learn a new language, and this page can help people get up and running quickly. The alternative would be having people find this stuff out themselves (the clojure stuff was especially unpleasant).
  2. Scala robots run fine. I have coded a basic guess factor targeting bot (similar to the algorithm used in the GuessFactor Targeting Tutorial) in Scala which is putting my pattern matchers to shame. I have not yet encountered a feature blocked by Robocode, though I don't use structural types because they require reflection and are thus slow.

There was a time when Scala robots required specific changes to Robocode, back in the days when Robocode would only let you load classes from the CLASSPATH if they were in the java.* or robocode.* packages. That is no longer true now that Robocode seems to let you load any class you want from the CLASSPATH. —Duyn 13:53, 25 January 2010 (UTC)

Well, you could have help us in Scala implementation. Contact me if you interested.
What I was worry at is when Robocode released plug-in which implement those languages, and if some newbie who are coding in, for example, Scala come across this page too, they might confused. --Nat Pavasant 14:06, 25 January 2010 (UTC)
For Scala, you don't need any extra effort. The Scala library just has to be on the CLASSPATH that Robocode is run with. Once that is done, everything just works (tested on Robocode
Clojure requires disabling the security manager because (on Windows) it tries to read the file \C:\...\clojure.jar when the correct path to its runtime is C:\...\clojure.jar (no initial slash). I'm guessing the problem is with Clojure, since Scala doesn't have the same issue.
As for any upcoming plugin, we can update the information when that happens. Until then, this page can help them get a start now.—Duyn 01:30, 26 January 2010 (UTC)
Well, developing Scala implementation including making sure that all features work, and document for features that don't work. And installer, and automatically merge in Robocode without needing user to add the line, and so... --Nat Pavasant 12:10, 26 January 2010 (UTC)