Can a program only use one programming language? -Php Tutorial

Source: Internet
Author: User
If not, how can we collaborate in multiple languages? What is the principle? If not, how can we collaborate in multiple languages? What is the principle? Reply content: a set of systems can be written in multiple languages, and there are also many ways of cross-language program collaboration.

For example, pipeline collaboration is supported, and the output of one module serves as the input of another module. For example, you can write MapReduce tasks in Python and run them in a Hadoop cluster written in Java. Java code is responsible for data distribution task scheduling, and Python code is responsible for processing.

For example, shared storage can be used. For example, you can use J2EE to write Web applications, MySQL for databases, and Python for background scripts.

Alternatively, RPC can be used, for example, Thrift, Java on the server side, and Python on the client side.

For example, you can use one language to develop extension modules in another language, for example, using C to develop extensions in Python/Java.
--------
However, for the team, to use multiple languages, make sure there are sufficient internal resources. Each language requires an expert programmer responsible for solving problems and complex problems, and a master role to ensure that the code can be properly maintained and updated in a timely manner. Not all teams have these conditions.

If these conditions are not met and the language is hard to use in multiple languages, the relatively "unpopular" language will become the efficiency killer of the team.

First, no one may know a large amount of practical experience required for the language. For example, properly organize code and commonly used resources in the ecosystem. No Review is made for code disorder, serious repetitive tasks, slow error troubleshooting, and unstable system;

Second, there may be no resources for the internal base library with the same preparation functions as the language and the construction of software sources, making the "unpopular" language construction slow and the necessary functions cannot be synchronized for a long time;

Finally, the most serious is the maintenance interruption. The departure of the relevant personnel and the legacy code became a burden for the successor, which required a lot of effort to learn a new language or reconstruct it in a familiar language. If the resigned employee is still a half-loose in this language, the program will be poorly written, and the time will be doubled.

Therefore, although multi-language mixing sounds cool, as a team, you must do what you need to do based on the skill stack of the members. There is a kind of thing called the linker. It allows us to mix many things.
For example, the binary hand-played machine code, the assembly language on the platform, the source files of C ++, C, D, Objective-C, Fortran, and so on, their products (target files) can be linked together to form a program.

Of course there are other technologies. For example, dynamic code execution, interpretation execution, dynamic loading, communication between components through various IPC mechanisms, and technology such as JavaBean/COM. There was a connector in ancient times and a Web API today. For processing data or statistics
I think using Excel can solve many problems quickly.
If not, you can learn the Excel macro commands.
In fact, Excel is more flexible than the database in terms of statistical functions.

In many cases, we increase efficiency not only through the self-learning program.
We can use the existing browser plug-ins of the tool or even small exe applications.
The program does not have its own rules to help you solve any problem.
You still need to solve the problem of exceeding the rules. this is a hybrid programming problem.

The answer is that a program can be written in any language, as long as you can communicate with each other in some way. No.
All languages can collaborate.
I want to learn from programmers, but I just want to solve some computer repetitive work and learn some scripting languages. Easier. Multi-language collaboration is supported.
There are two methods:
1) direct inter-language calls. This method supports languages. Generally, high-level languages can directly call libraries of c/c ++. you can refer to swig, an open-source project, you can generate many advanced language bindings for c/c ++. You can use an embedded parser to call a high-level language in a low-level language. it is especially convenient to use a C language to call a lua script. High-level languages call each other. Generally, they must be bonded by low-level languages.
2) ipc mechanism. It is easy to implement through independent descriptive languages such as asn, proto, json, and xml using the system's ipc mechanism. Let's look at the open-source project apache thrift, which facebook contributed previously. No. Currently, C ++ and Lua are not necessarily used to write games using cocos2dx. VS can be used together in a bunch of languages.

I did this when I didn't know how to use pascal to execute exe: bat creates a loop, first executes the pascal program, and is responsible for input and output. at the end of the pascal program, a new bat file is output, then it ends. The new bat is called, run, and then run a pascal program. Loop, and then package the heap with winrar to decompress the package ~ I felt very great. The most obvious example is embedded SQL, which is used in many languages ~ _~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.