• Log in or sign up for an account here: https://www.sythe.org/login

C++ and Java Question

cullmaan

Apprentice
Joined
Jan 25, 2006
Sythe Gold
2
Messages
653
Age
34
Location
cloud 9
C++ and Java Question
Is it possible to write a part of a project in c++ and some parts in java? Or is this something that people just don't do?
 
C++ and Java Question
I mean you could write a program in one language and then use that output as input for another program written in a different programming language.
 
C++ and Java Question
OOOH okay gotcha. Would the user have to download more than 1 file? or is there a way to like combine it... need answers XD
 
C++ and Java Question
I'm just curious how you would be able to have C code thats produces output for the java code to use as input. Like is this normal practice maybe for more efficient code because c is a lower level language than java is.

What are you actually doing?
I just want to know as much as anyone can tell me about this. I'm not working on any projects ATM
 
C++ and Java Question
It is definitely possible, as to how to do it, I have no clue. There are thousands of unique programming languages which can be custom, so i'd imagine that someone has implemented the use of two common languages into their custom language.
 
C++ and Java Question
Yeah, I'm not ready to create my own programming language, I wish I could. I read that you can do inline ASM in your C/C++ code, I wish it was possible to do the same with java and c++ without using a unique programming language. Could you point me in the right direction of a website with like a list of homemade programming languages?
 
C++ and Java Question
Perhaps you could look into exporting any data you would need into a JSON format. There are JSON parsers available in essentially any language. You could also use an AMQP buffer such as RabbitMQ to send results to from one set of code to the other. AMQP is a message broker and with implementing listeners, you could easily transfer data from any language to another.
 
C++ and Java Question
Don't do whatever you're trying to do, and don't use Java. Thanks!

No one likes Java. Fact. I wish everyone would stop coding in that language...
 
C++ and Java Question
Perhaps you could look into exporting any data you would need into a JSON format. There are JSON parsers available in essentially any language. You could also use an AMQP buffer such as RabbitMQ to send results to from one set of code to the other. AMQP is a message broker and with implementing listeners, you could easily transfer data from any language to another.

Thank you so much for your response. I looked at RabbitMQ and it seems pretty simple, are JSON parsers pretty simply to set up as well?

Don't do whatever you're trying to do, and don't use Java. Thanks!

No one likes Java. Fact. I wish everyone would stop coding in that language...
Haha well what else should i use for a graphical user interface with buttons and what not? I really want to be able to do this with C++ but I'm not sure how to do that...maybe i should learn c#?
 
C++ and Java Question
I don't really know C++ but I see no reason why you would ever need to use C++ and Java together. Java and C# were both developed after C++ because it's complexity was too much and cumbersome.
 
C++ and Java Question
and the term you are looking for is interpreter, when you compile a programming language you use a compiler. When you compile a program with multiple languages you use an interpreter.
 
C++ and Java Question
I don't really know C++ but I see no reason why you would ever need to use C++ and Java together. Java and C# were both developed after C++ because it's complexity was too much and cumbersome.

Java is used a lot in enterprise. Perhaps you need a preexisting enterprise application to work closely with a highly turned and efficient program to do something else. C++ would be your best bet there.
 
C++ and Java Question
Java is used a lot in enterprise. Perhaps you need a preexisting enterprise application to work closely with a highly turned and efficient program to do something else. C++ would be your best bet there.

And so do you use an interpreter that can read and interpret c++ and java into machine language.. Or is this commonly used with for example a JSON parser, or a AMQP buffer? Or are there more complex ways to do this.. I feel like my original questions have been answerwd but you guys just gave me some new info
 
C++ and Java Question
Obviously it's possible, there are bridges for alot of languages, usually one would extend their project with C. IE. when using Python, if you need a faster function, you'd write that part in C.

JNI is useful to allow Java to call and to be called by other programs/programming languages.

Here's a bridge(note: I never used this) that you can use, that uses JNI under the hood: https://code.google.com/p/javacpp/

But my recommendation is, stick to one programming language, as the only real reason to integrate Java and C++ is legacy code/or performance reasons.
 
C++ and Java Question
And so do you use an interpreter that can read and interpret c++ and java into machine language.. Or is this commonly used with for example a JSON parser, or a AMQP buffer? Or are there more complex ways to do this.. I feel like my original questions have been answerwd but you guys just gave me some new info

Java doesn't make it to machine language. It's run in a virtual machine. You would connect them however you want really. You just need some way for them to pass messages back and forth. For all I care, you could simply use HTTP or email (lol but that would suck).
 
C++ and Java Question
The way it would work is something like this:


1)C++ Code Would have some data it needs to give to the Java code. It puts all of this data within a JSON Object
2)C++ Code makes communication with a RabbitMQ (AMQP) server to hold the JSON - sends the JSON to it.
3) Java Code is listening to the same RabbitMQ (AMQP) server - once the JSON arrives, it pulls it down
4) Java Code parses the JSON to find what data it needs.
 
C++ and Java Question
The way it would work is something like this:


1)C++ Code Would have some data it needs to give to the Java code. It puts all of this data within a JSON Object
2)C++ Code makes communication with a RabbitMQ (AMQP) server to hold the JSON - sends the JSON to it.
3) Java Code is listening to the same RabbitMQ (AMQP) server - once the JSON arrives, it pulls it down
4) Java Code parses the JSON to find what data it needs.


Im gonna practice this soon. So now I'm wondering can you make a call to the system to open up a c++ program run it to get the data and then close the program?...like say i had a java program and i had a fast algorithm written in c++ to find a defintion from a list of 100,000 definitions... Would this be a easy and safe way to complete a task?
 
Runescape Gamblingrunescape gambling
Back
Top