If not, how can multiple languages collaborate? What is the principle?
Reply content:
A set of systems can be written in multiple languages, and there are many ways to collaborate across language programs.
For example, you can pipeline collaboration, the output of one module as input to another module. For example, you can write a MapReduce task in Python and execute it on a Hadoop cluster written by Java. The Java code is responsible for scheduling data distribution tasks, and Python code is responsible for processing.
For example, you can share storage. For example, using Java EE to write a WEB application, database with MySQL, background script executed in Python.
Or you can use RPC, such as using Thrift, the server is in Java, and the client is called with Python.
Another example is the development of an extension module in one language, such as the development of Python/java with C.
--------
However, for the team, using multiple languages is essential to ensure that there is sufficient internal resources. Each language needs to have an expert-level programmer, responsible for troubleshooting, and the main role, to ensure that the code can be properly maintained and updated in a timely manner. These conditions are not available to all teams.
Lack of these conditions and hard to multi-lingual, relatively "unpopular" language will become the team's efficiency killer.
First, there may be no one who knows a lot of the necessary practical experience in the language. such as the proper organization of code, the resources commonly used in the ecosystem. Cause code Confusion No one Review, repeat the wheel serious, error troubleshooting progress slow, system instability and so on;
Second, there may be no resources for the language to prepare the same internal base library, building software sources, so that "unpopular" language construction is slow, the necessary functions are not synchronized for a long time;
Finally, the most serious, maintenance interruption. Related personnel leave, legacy code has become the burden of personnel, whether it is a new language or the use of familiar language reconstruction is to waste a lot of energy. If the departing person itself is still the language of the Dabbler, the program is poorly written, it takes more time to double.
So, multi-language mixing though sounds cool, but as a team must be based on the skill stack of the members. There is a thing called a linker. It allows us to mix a lot of things.
For example, binary hand machine code, Platform assembly language, C++,c,d language, Objective-c,fortran and so on source files, their products (target files) can be linked together to form a program.
There are, of course, some techniques. For example, dynamic code execution, or simply explaining execution, dynamic loading, or communicating various components through various IPC mechanisms, as well as techniques such as javabean/com, etc. There is a web API for the old connector. If you are working with data or statistics
I think a lot of problems can be solved quickly by using Excel skillfully.
If it's not enough, you can learn Excel macro commands
In fact, Excel is more flexible in statistical function than database.
Most of the time, we're not just using self-learning programs.
We can use the tools already have browser plugins and even EXE small applications
The program has its own rules and it's not something you can do to solve any problem.
Beyond the rules of the problem you still have to solve it yourself ah, this is a mixed programming problem.
The answer is that a program can be written in any number of languages, as long as you can use some way to make them communicate with each other. No.
Languages can collaborate.
Want to learn the programmer, but want to solve some computer duplication of labor to learn some scripting language is good. More simple. Can collaborate in multiple languages.
Generally two ways:
1) direct calls between languages. In this way language support, the general high-level language can directly call C + + such a low-level language library, you see swig this open source project, you can generate a lot of high-level language bindings for C + +. Low-level languages call high-level languages, which can be implemented through inline parsers, and C-language calls to Lua scripts are especially handy. High-level languages call each other, usually through low-level language bonding.
2) IPC mechanism. It is easy to achieve this by asn,proto,json,xml The independent description language of these languages and by using the IPC mechanism of the system. Take a look at Apache Thrift, an open source project that was previously contributed by Facebook. No, now using COCOS2DX to write games is not necessarily C + + and Lua. VS can be on a bunch of languages together.
When I did not know how to use Pascal to execute EXE when I did this: bat create a loop, first executed Pascal program, responsible for input and output, Pascal program end output A new bat file, and then end. The new bat is called by the old Bat, runs, and then executes a Pascal program. Cycle, and then put this pile of things with winrar packing self-extracting ~ that year feel very great look. The most obvious example, Embedded SQL, will be used in many languages ~_~