Thread: How to use multiple languages (c++ , Javascript and HTML) in a common project?

  1. #1
    Registered User
    Join Date
    Nov 2018
    Posts
    1

    How to use multiple languages (c++ , Javascript and HTML) in a common project?

    How to use multiple languages like c++ and HTML in a common project.
    I have always wondered how do the algorithms in c and c++ work in websites?

    can anyone tell me. I have read that some of the google's search algorithms have been written in c++ and c but how it work?


    Any information given will be appreciated.

    Regards

    Prachu

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Algorithms and data structures don't care about languages.

    A sort function written in C, C++, Python, Javascript, blah, yawn, whatever is still a sort function.
    > How to use multiple languages like c++ and HTML in a common project.
    You use whichever language is best suited to the task.



    A valid HTML document - Free tutorial to learn HTML and CSS
    Your browser doesn't give a damn whether the server at the other end uses C, C++ or whatever.

    So long as a valid HTML document gets transmitted down the socket connection, you're free to do whatever you want at the other end.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by Salem View Post
    Algorithms and data structures don't care about languages.

    A sort function written in C, C++, Python, Javascript, blah, yawn, whatever is still a sort function.
    > How to use multiple languages like c++ and HTML in a common project.
    You use whichever language is best suited to the task.



    A valid HTML document - Free tutorial to learn HTML and CSS
    Your browser doesn't give a damn whether the server at the other end uses C, C++ or whatever.

    So long as a valid HTML document gets transmitted down the socket connection, you're free to do whatever you want at the other end.
    What if you had to integrate two language like Python and C++ to make an exectuable

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User FortranLevelC++'s Avatar
    Join Date
    May 2013
    Location
    United States
    Posts
    81
    Mixed language programming is becoming much easier, thanks to new tools that are being developed. Even for non-CS majors like me this is becoming easier!

    As Salem pointed out, you can call C++ from Python, and here is another link:

    Calling C++ Classes from Python, with ctypes… – Auctoris

    And of great interest is the 'f2py' utility that allows you to access Fortran from Python, in such a way that you can actually compile the Fortran from Python:

    Calling Fortran from Python with f2py

    This is one reason to be interested in Python.
    All the data manipulation and plotting libraries of Python are wonderful, but once you can call C++ and Fortran from Python,
    this gives you the ability to compartmentalize the heavily computational parts of the program and get the best of the two worlds.

    And when it is difficult to pass very complicated arguments to a function that comes from another language,
    you can actually write the data to a disk file from your primary program, and then, without interrupting the primary program,
    you can launch another executable written in the other language, as a process from within your primary program. Launching
    processes would work extremely well when you are delegating a heavily computational task that would take a long time.
    Last edited by FortranLevelC++; 11-28-2018 at 12:52 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 07-23-2012, 12:15 AM
  2. Javascript and HTML forum
    By xniinja in forum General Discussions
    Replies: 4
    Last Post: 01-12-2011, 09:48 PM
  3. How to handle multiple cases which use common code?
    By tmaxx in forum C Programming
    Replies: 3
    Last Post: 10-03-2008, 07:42 AM
  4. HTML/Javascript Getting by certain code?
    By two31d in forum Tech Board
    Replies: 4
    Last Post: 11-08-2005, 08:10 AM
  5. Multiple Languages
    By Korn1699 in forum Windows Programming
    Replies: 5
    Last Post: 09-16-2004, 07:14 PM

Tags for this Thread