C++ and Java Question

Discussion in 'Programming General' started by cullmaan, Aug 18, 2013.

C++ and Java Question
  1. Unread #1 - Aug 18, 2013 at 10:05 AM
  2. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    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?
     
  3. Unread #2 - Aug 18, 2013 at 7:05 PM
  4. AskJava
    Joined:
    Aug 14, 2013
    Posts:
    16
    Referrals:
    0
    Sythe Gold:
    0

    AskJava Newcomer

    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.
     
  5. Unread #3 - Aug 18, 2013 at 11:11 PM
  6. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    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
     
  7. Unread #4 - Aug 19, 2013 at 7:37 AM
  8. Darkest Dream
    Joined:
    Jun 26, 2013
    Posts:
    7,457
    Referrals:
    1
    Sythe Gold:
    544
    Vouch Thread:
    Click Here
    Discord Unique ID:
    624783392625524785
    Sythe RSPS Player Two Factor Authentication User In Memory of Jon Christmas 2015 Doge Halloween 2013 Sythe's 10th Anniversary Off Topic Participant Gohan has AIDS
    Heidy Lawrence

    Darkest Dream I prefer to have my nightmares with open eyes.
    Darkest Dream Donor

    C++ and Java Question

    What are you actually doing?
     
  9. Unread #5 - Aug 19, 2013 at 8:16 AM
  10. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    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.

    I just want to know as much as anyone can tell me about this. I'm not working on any projects ATM
     
  11. Unread #6 - Aug 20, 2013 at 7:36 PM
  12. kmjt
    Joined:
    Aug 21, 2009
    Posts:
    14,450
    Referrals:
    8
    Sythe Gold:
    449

    kmjt -.- The nocturnal life chose me -.-
    Banned

    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.
     
  13. Unread #7 - Aug 20, 2013 at 9:53 PM
  14. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    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?
     
  15. Unread #8 - Aug 31, 2013 at 1:41 AM
  16. sacred421
    Joined:
    Apr 12, 2009
    Posts:
    862
    Referrals:
    2
    Sythe Gold:
    1

    sacred421 Apprentice

    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.
     
  17. Unread #9 - Aug 31, 2013 at 7:54 AM
  18. Alex_J_Leon
    Joined:
    Jan 3, 2006
    Posts:
    1,692
    Referrals:
    0
    Sythe Gold:
    969
    Yellow rat Bitch! Heidy Why can't I hold all of these feels? Lumpy Space Princess 420 yolo swag blaze it fuck the popo legalize it anyone got some chips Le Monkey Doge UWotM8? Not sure if srs or just newfag...
    Spyro Wubba Lubba Dub Dub Wait, do you not have an Archer rank? Smashing Rupee I'm LAAAAAAAME Penguin Green eggs and spam Pizza Muncher MushyMuncher

    Alex_J_Leon Guru
    Mudkips

    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...
     
  19. Unread #10 - Sep 1, 2013 at 11:41 AM
  20. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    C++ and Java Question

    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?

    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#?
     
  21. Unread #11 - Sep 1, 2013 at 12:33 PM
  22. legame
    Joined:
    Apr 5, 2013
    Posts:
    9
    Referrals:
    0
    Sythe Gold:
    0

    legame Newcomer

    C++ and Java Question

    Defiantly possible, but I can't see why anyone would do that.
    Depending on what you're doing you could maybe use bash scripts or use some other solution to get it done. Wouldn't recommend it though, would get too messy.
     
  23. Unread #12 - Sep 1, 2013 at 8:13 PM
  24. sacred421
    Joined:
    Apr 12, 2009
    Posts:
    862
    Referrals:
    2
    Sythe Gold:
    1

    sacred421 Apprentice

    C++ and Java Question

    JSON is really easy to use once you know the structure, and all the parsers are pretty straightforward
     
  25. Unread #13 - Sep 6, 2013 at 3:04 PM
  26. goldenshades
    Joined:
    Aug 15, 2013
    Posts:
    258
    Referrals:
    0
    Sythe Gold:
    0

    goldenshades Forum Addict
    Banned

    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.
     
  27. Unread #14 - Sep 6, 2013 at 3:05 PM
  28. goldenshades
    Joined:
    Aug 15, 2013
    Posts:
    258
    Referrals:
    0
    Sythe Gold:
    0

    goldenshades Forum Addict
    Banned

    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.
     
  29. Unread #15 - Sep 6, 2013 at 3:41 PM
  30. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    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.
     
  31. Unread #16 - Sep 7, 2013 at 11:21 AM
  32. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    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
     
  33. Unread #17 - Sep 7, 2013 at 3:34 PM
  34. Syed
    Joined:
    Jan 22, 2009
    Posts:
    9,857
    Referrals:
    1
    Sythe Gold:
    11
    Sythe Awards 2012 Winner Gohan has AIDS (3) ??? Rust Player I'm LAAAAAAAME (2) Shitting Rainbow (2)

    Syed Hero
    Retired Sectional Moderator $50 USD Donor New

    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.
     
  35. Unread #18 - Sep 7, 2013 at 3:40 PM
  36. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    C++ and Java Question

    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).
     
  37. Unread #19 - Sep 9, 2013 at 7:34 PM
  38. sacred421
    Joined:
    Apr 12, 2009
    Posts:
    862
    Referrals:
    2
    Sythe Gold:
    1

    sacred421 Apprentice

    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.
     
  39. Unread #20 - Sep 9, 2013 at 9:50 PM
  40. cullmaan
    Joined:
    Jan 25, 2006
    Posts:
    653
    Referrals:
    0
    Sythe Gold:
    2
    Tier 1 Prizebox

    cullmaan Apprentice
    $25 USD Donor New

    C++ and Java Question


    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?
     
< Looking for A* help | help >

Users viewing this thread
1 guest


 
 
Adblock breaks this site