DEV Community


Can you combine programming languages

Ye i use what else do u want?
・1 min read

Can i combine php and python(Sounds a bit crazy) With a custom programming language which i can make? like how facebook made their own php.Just wanted to ask you guys,before i start searching for some help :)

Discussion (2)

xanderyzwich profile image
Corey McCarty

There are lots of cases of different languages interacting with one another. You just have to figure out how you want to interact. The most common ways to make them interact would be with either a system call or a REST call. You would build one application in a single language and have it make a call to another application that uses another language. There are many ways for them to communicate. There are even pairings such as C and C# that have adapters for interacting with one from the other directly in the same code base.

hentaichan profile image

Alternatively to what have been already said, you could also use scripting languages such as bash or PowerShell to glue together different apps. Numpy for example is written in C and provides a wrapper for python. C# may also use C++ code, and so on. Sometimes it makes sense to switch between languages in a single project (for performance reasons, or because a certain language has a really good library for one specific task), but this also adds more complexity to your project so it's a tradeoff you have to really think about before you make this decision.