What language to use for most comatibility

Hello

(2 part question)
- I am planning to write an interpreter. Anyone know of any good books on the topic?

- Now the 2 langages I'm considering are C++ and Java

The reason for choosing C++ is Borlands new C++ Builder which can compile the code for windows, Linux and Solaris.

The reason for choosing Java is because Java can be executed on Windows, Unix, Apple and most probably Linux also.

Up till now I have been using Visual studio to design software using C++, but the key elements of this project need to be compatibility accross platforms and SPEED.

Can anyone give me an insight to what code executes faster C++ or Java or is there another langage I should consider when thinking of speed?

Also what Language and Development environment should I use to capitalize on the most possible cross platform compatibility?

I was even thinking C code for a while because it can be embedded (But is it worth the complexity). To use such a low level langauge.

Regards  
auk_ieAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jcwlcCommented:
C is not a low level language and C++ is basically a superset of C and gives it an OO flavour. Java was originally intended for web development and removes many of the difficult concepts in C/C++ that programmers had trouble with, namely pointer notation. Java is also 'more' OO by design.

However, any 'engine' type code, such as your interpreter or number crunching or string processing or graphic or io manipulation is handled far better in C/C++. You are much 'closer' to the machine level and can exercise more control over memory and other system resources. Java makes your memory management life easier, but comes at a performance cost.

For best speed, flexibility and performance go C/C++ and stick to ANSI if you want it to run on platforms other than win32.

Also, You could split your program and use both technologies... C/C++ for the intensive processing part, java for the user interface driven parts. Use JNI to get them to talk.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
harris_cCommented:
Check this out:   Comparison b/w C, C++, D, Java and C#

http://www.windevnet.com/wdn/webextra/2003/0313/


hec",)
0
marcin1Commented:
jcwlc is right, Java is not good for this project. Java was designed to write portable applications, which can be run on PC, mainfames, and mobile phone.

The main difference is that C/C++ programs are compiled directly to the low-level machine code, which makes it fast, but machine dependent. Java is compiled to the platform independent intermediate language, which can be run on anything that has the virtual java machine. That unfortunately affects speed of application.

The point is that you don't want the application itself to be used on different platform, you want only to port the code, so you don't need the features of Java.
0
cookreCommented:
Bear in mind, however, there's speed and there's speed.  

Unless your scripts are expected to be long ones with palpable run times, what does it matter if the C version runs in barely two seconds where the Java one runs nearly 3 seconds?  In a case such as that, I would opt for ease of mantenance - in particular if you expect your scripting language to grow.

Note further that if your scripting language is fairly simple, the bulk of the time won't be spent parsing, it will be spent executing the parsed commands, in which the lion's share of the heavy work will be done by API calls into the same DLLs, regardless of which language was used.
0
auk_ieAuthor Commented:
OK, so C++ seems to be a winner, But Java did come close behind (speed is essential for me). Ofcourse by using C++ I loose the amount of compatibility I had when using Java. I mean The virtual java machine can run on anything (Apple, Windows, Unix etc.). But The Borland Compiler C++ Builder only compiles for Windows, Linux and Solaris. Does anyone know how I can easily port the code over to Unix and Apple as well.

I'm asking cause so far I only have experience programming Windows 9X, NT, 2K and XP using visual studio. So I want to buy correctly if I want to develop for these new softwares.

I am surprised nobody mentioned C sharp. Some say this will replace C++. And that it is operating system independant. However it does require, Does anyone know what operating systems the dot net framework is available for?

Nobody mentioned anything about a book on the topic of interpreters neither?

   
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.