Go to Post Quitting FIRST was so hard that I felt like I needed a 12 steps program to help me through it. - Ken Leung [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-01-2011, 00:51
Walker Walker is offline
Registered User
FRC #1318
 
Join Date: Jan 2011
Location: Washington
Posts: 5
Walker is an unknown quantity at this point
Clojure and Scala

To pass the time until kickoff, I've been writing a few utility apps for robotics using Clojure and SWT. Programs that would calculate seeding points, things like that. A thought hit me while I was working on this project: could you write the code for the robot using either Clojure or Scala? (Two new languages created on the JVM that are getting a lot of popularity.)

Not having a lot of experience with the JVM, I don't know exactly how the packaging process works with Clojure. I know that it can produce an executable jar just like Java can, and I know that there is a build dependency on the clojure libs, but does the executing JVM still require any pre-installed Clojure files? If it didn't, then how hard would it be to tell Netbeans to add the Clojure libraries to the classpath and dependency list, compile the clojure files, and send that jar to the robot?

The same goes for Scala, which I've pretty much only heard of, although most of what I've heard are good things. Has anyone experimented with the form of Java on the cRio like this?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-01-2011, 01:11
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: Clojure and Scala

I don't know the implementation details for Clojure and Scala, but often languages that are implemented on top of a Java VM use advanced features like reflection***.

The Java system provided for FRC is a "Java Micro Edition" version of Java (Java ME) that doesn't support reflection.

*** Reflection is an interesting feature that allows you do things like:
  1. ask "hey object, what fields do you have"
  2. given that info, get or set field values.
  3. similarly discover and call methods on an object

In Java Standard Edition (Java SE) the reflection classes are in the java.lang.reflect package.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-01-2011, 20:18
Jeanne Boyarsky Jeanne Boyarsky is offline
Java Mentor
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 100
Jeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud of
Re: Clojure and Scala

As a more definitive no:

1) As Derek noted JME (Java Micro Edition) is memory constrained and does not support all the features of Java. Scripting languages are a known item that doesn't work.

2) As of last year, the cRio wasn't on the latest version of Java. (I believe it was on 1.4). Scripting language integration with Java didn't exist in 1.4 (or 5) in even full versions of Java.
__________________
Team 694 mentor 2010-present, FIRST Volunteer and Co-organizer of FIRST World Maker Faire Tent
2012 NYC Woodie Flowers Finalist
2015 NYC Volunteer of the Year
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thanks to 1742 and 1209/Congrats to 2410, 935, and 1987 vhcook Thanks and/or Congrats 4 28-03-2010 15:50
Boilermaker Regional - WFFA and Volunteer Award and the Trio! Chris Fultz Thanks and/or Congrats 1 21-03-2010 14:05
Congratulations and Thank you to Team 341, 694 and 3204! AnibaS Thanks and/or Congrats 2 18-03-2010 07:40
Thank You and Congrats to Teams 20, 2079, 195, and 1124! Chris is me Thanks and/or Congrats 12 16-03-2010 09:16


All times are GMT -5. The time now is 11:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi