View Single Post
  #1   Spotlight this post!  
Unread 16-11-2009, 05:30
alivemyst alivemyst is offline
Registered User
no team
 
Join Date: Sep 2009
Location: California
Posts: 10
alivemyst is a glorious beacon of lightalivemyst is a glorious beacon of lightalivemyst is a glorious beacon of lightalivemyst is a glorious beacon of lightalivemyst is a glorious beacon of lightalivemyst is a glorious beacon of light
Ported: Javascript for 2010

After a solid night of hacking, I've managed to port Mozilla's Rhino Javascript Engine(http://www.mozilla.org/rhino/) over from a half baked J2ME implementation(http://sourceforge.net/projects/rhinoj2mecldc/) to the 2010 FRC Java system--squawk VM etc.
I'll post the code shortly, but some notable features

Running the rhino js engine allows you direct access to Java libraries and classes as well as Javascript code.
Javascript is fully interpreted in rhino(if someone wants to work on a JIT compiled V8 implementation, let me know ), but any Java calls will have equal performance to a normal java setup because they go straight to the JVM.
My implementation of rhino utilizes a socket on the cRIO, allowing users an interactive console with the cRIO as code is executed.

What does this mean for FRC? Well to put this in perspective--
Using this system, you can write as much of your code as you please in javascript(the benefits and conveniences of which are many) and still utilize the robot control libraries that are part of the new WPILibJ.
Using this system you can have an interactive console to your robot, and have code interpreted on the fly--that's right, no deploy, no compile.
[If you are nuts, you can replace your driverstation joysticks with a keyboard and a pair of competent coders, and drive your robot with code ]
You can easily toy with code as it runs on the robot.
You can teach and learn javascript with your team members, which is in many ways friendlier than Java while maintaining an un-weird syntax.
And much more...
Reply With Quote