OCCRA
Go to Post 254 bends CIM shafts every now and then in the drivetrain. I didn't believe it was possible until I saw it myself. - AustinSchuh [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Events   CD-Media   CD-Spy   FRC-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 01-27-2010, 11:43 AM
L337Lobster L337Lobster is offline
L337 Programmer
AKA: Jackson
FRC #0225 (Awesome-O)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: York
Posts: 5
L337Lobster is an unknown quantity at this point
Question From C++ to Java

Ok so this year i decided to program for my robotics team. Last year the code was in C++. The only problem is that i do not know C++, but luckily i know Java. So i found a C++ to Java converter. This would be wonderful if i actually had all the libraries that it needed to convert it. I asked my leader about it and he said that they had changed the names of some of the libraries. The libraries (if library is not the correct term please correct me as i am unfamiliar with C++) that i can not find are:
  • archMc68.h
  • archSparc.h
  • archI960.h
  • archAm29k.h
  • archSimpentium.h
  • archMips.h
  • and others
If anyone could help me with this it would be wonderful because i would rather not convert it manually. Or just tell me if you think it would be easier just to start from scratch.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-27-2010, 05:46 PM
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: From C++ to Java

The converter tool is chasing through WPLib and the vxworks headers, and is looking for files that doen't exist even for C++ code.


I don't know the tool you are using, but try to limit it to your robot code itself. WPILib is already converted - you don't need to convert it again :-)

There will be errors, but they should be easy to fix.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-27-2010, 06:46 PM
L337Lobster L337Lobster is offline
L337 Programmer
AKA: Jackson
FRC #0225 (Awesome-O)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: York
Posts: 5
L337Lobster is an unknown quantity at this point
Re: From C++ to Java

i dont need to convert the library im converting the code that my team used last year
Reply With Quote
  #4   Spotlight this post!  
Unread 01-28-2010, 12:15 AM
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: From C++ to Java

Good, we agree that you don't need to convert the library, but I believe that the translator tool was doing it anyway.

You didn't say what converter tool you were using, or how much robot code you have to convert, so I can't give specific advice. I can say that when WPI students ported WPILib from C++ to Java, they essentially used "cut and paste", then fixed the syntax errors. [They had to do a lot more work on FPGA interfacing, etc, that you don't need to worry about it.]

If you are interested in converting from C++ to Java on your own you need to be familiar with differences between C++ objects and Java objects (C++ objects can be on stack, static memory, or in heap, '.' vs. '->'). Also, the Java version of WPILib all method names begin with lowercase letters.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-28-2010, 04:07 PM
L337Lobster L337Lobster is offline
L337 Programmer
AKA: Jackson
FRC #0225 (Awesome-O)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: York
Posts: 5
L337Lobster is an unknown quantity at this point
Re: From C++ to Java

The converter I was using is called Tangible Converter.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-28-2010, 05:33 PM
davidalln's Avatar
davidalln davidalln is offline
World's Worst Coder
AKA: David Allen
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Atlanta, GA
Posts: 108
davidalln is on a distinguished road
Send a message via AIM to davidalln
Re: From C++ to Java

C++ and Java are strikingly similar languages in terms of syntax. I would encourage you to not use a translator as they can be frequently inaccurate especially with the high sensitivity of WPILib and just translate the code by hand. It shouldn't be too difficult and if you need help just post chunks and I'm sure someone will help out
__________________
SANTOSH ANDREW DECKER RICK WYNNIE SEAN DEREK MATT
(alamo (semis), p'tree (CHAMPS!), nc (CHAMPS!), newton (quarters))


Best four years of my life. Thanks to everyone who made it happen.
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
C++ vs. Java Performance manderson5192 Java 9 12-05-2009 08:01 PM
Java team1512 Java 2 10-21-2009 06:36 AM
Java vs. C++ nickmagus Programming 3 09-05-2009 07:23 PM
**FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** Pjohn1959 Programming 37 08-31-2009 03:55 PM
java to pbasic nzj1 Programming 11 01-09-2003 07:24 PM


All times are GMT -5. The time now is 07:55 AM.

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


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