Combining language | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Combining language

is it possible to combine two programming languages at a time?

19th Oct 2018, 11:59 AM
1704086_ibnul
1704086_ibnul - avatar
12 Answers
+ 7
It is totally possible, through some modules in Python: https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages But for example you can mix Python with SQL in Sololearn: https://code.sololearn.com/csyhsIovmZJ3/?ref=app
19th Oct 2018, 4:08 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Daniel Holmes No problem, the question was vaguely poised anyway :) I give a rest to SQL case as well -- let them historians solve it one day ;)
19th Oct 2018, 8:30 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Daniel Holmes I don't think the question was that specific... Anyway, sure those are translators, but how else would you be able to run it? By the way, Jupyter Notebook allows you to insert C++, Java and even Scala snippets from within the Python kernel. Oh, and SQL is a programming language alright. Why wouldn't it be?
19th Oct 2018, 7:18 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Bebida Roja, this is not exactly what the author asked, I think. You have a separate python script and a separate C ++ code. And you can call the script on python in C ++ code. But you cannot combine these 2 languages in one project and compile them into one assembly.
19th Oct 2018, 12:35 PM
Daniel Holmes
Daniel Holmes - avatar
+ 1
It's not possible here on SoloLearn but there are way to execute java code in a website (on the server side) for example. But they can't stay in the same file
19th Oct 2018, 12:31 PM
Daniele Bonomi
Daniele Bonomi - avatar
+ 1
I needed to make a program that parses some file and then do some processing, and I used C++ for the processing and python for the parser. it was so much easier
19th Oct 2018, 12:31 PM
Bebida Roja
Bebida Roja - avatar
+ 1
thank you everyone...
19th Oct 2018, 4:31 PM
1704086_ibnul
1704086_ibnul - avatar
+ 1
Kuba Siekierzyński, SQL isn't programming language. You can say same about PHP and HTML, but html isn't a programming lang. too
19th Oct 2018, 6:16 PM
Daniel Holmes
Daniel Holmes - avatar
+ 1
Kuba Siekierzyński, What you are talking about is a different implementation of translators for python. it does not give you the opportunity to write 1 project simultaneously in python and c ++ and compile it as a whole
19th Oct 2018, 6:21 PM
Daniel Holmes
Daniel Holmes - avatar
0
it's impossible. One code file contains only 1 programming language, since It is difficult to make a compiler that will parse the file by languages. But you can create 2 separate projects in different languages, one of them can launch another, transfer some data to it and receive a response.
19th Oct 2018, 12:23 PM
Daniel Holmes
Daniel Holmes - avatar
0
Daniel Holmes Yeah, i misunderstood it...
19th Oct 2018, 7:50 PM
Bebida Roja
Bebida Roja - avatar
0
Kuba Siekierzyński, if you use the correct interpretation of the term "programming", then you do not programming in SQL, but write structured queries. About the rare special cases of such a mixture of languages ​​I agree with you. I think we initially understood the autor's question differently. I apologize if i don't understand you.
19th Oct 2018, 8:06 PM
Daniel Holmes
Daniel Holmes - avatar