The evolution of programming languages

Source: Internet
Author: User

In the morning, I read an article, "The Eternal Way of Lisp," which solves my doubts about Lisp programming language, deepens the DSL (Domain programming language), and understands the programming language more and more deeply. The purpose of writing an article is to look at the evolution of the main programming language to see the process of programming language development and behind the design philosophy, of course, this is only my own understanding, if there are shortcomings, please bo friends advice.

Machine language

The earliest programming language was the cassette, the machine language, which had no semantics and no syntax, and that the operators and data were mixed together, biased toward specific devices, and relied on the feeling of hardware.

Assembly

Then, assembly language appears, assembly language defines the basic grammatical structure, defines the operator and data type, but the assembly language is specific hardware programming, such as CPU, I remember the university when learning is 8086 assembly language programming, this is for Intel 8086CPU programming language, if the CPU is 80386, then you have to program 80386 of the CPU, portability is very poor. If the entire set of code is to be re-written for each CPU, it will be complicated and difficult to imagine.

C language

For assembly language problems, mainly to solve the cross-hardware platform, then how to solve this problem, yes, add an abstraction layer, this is the hardware abstraction layer, it hides the specific platform hardware interface details, for the operating system to provide virtual hardware platform, so that it has hardware-independent, can be ported on a variety of platforms. Equivalent to provide a unified API such as C printf function, print string, because each terminal device type and model are different, need to be adapted to each terminal device, then through a terminal virtual hardware, it carries out the various end-difference shielding, provide a unified external interface, a bit similar to the adapter mode. The program written out in C language. Although this simplifies the operation of the hardware of this complex line, but the direct write operation of the virtual hardware code is also very hard, so there is a system kernel, to provide a higher level of abstraction, so the C language operation of the hardware function will call the system kernel, from the system kernel to call the specific virtual terminal equipment. This is related to the specific operating system, the C language compiler compiled code is associated with the operating system. So C language program is difficult to do cross-operating system platform, because each operating system provides private functions, and compiled binary code is not the same, cross-platform is basically impossible.

Advanced Language: Java,.net

To solve the cross-platform problem of C language, consider adding an abstraction to the operating system layer. Then there are programming languages such as Java and. Net. By implementing a JVM virtual machine, Java masks the differences of each operating system, and defines a standard target code (class file) that can be executed by the JVM as long as the class file satisfies the specifications defined by the JCP. This solves two problems, the target code format is fixed, the platform is the same, function calls are all the same, and the JVM deal with. This makes it possible to cross the operating system platform. However, there is still a problem, the implementation of the JVM can only get the common parts of the operating system abstraction, but some operating system private personalization is not masked, only by opening a small backdoor, so that developers can develop operating system-based native implementation.

DSL Domain programming language

Well, the development of programming languages to this layer is already very advanced, and for developers, it's easy enough. No hardware required just, do not need to understand the operating system knowledge. If it's going to happen, yes, it can be a cross-programming language. Also, programming languages are generally syntactically and semantically bound together, such as int c = A + b This assignment statement, we know to add a and B to C, the equivalent of knowing the syntax, we know the semantics, then is it possible to separate the semantics and syntax?

Semantics: Define c = Add (b,c) or <opteration name= "add" result= "C" ><param= "A, B"/></opteration>

Then the translation into the Java language is int c = a + B; Convert to javasrpit var c = A + B etc.

The equivalent of what and how to separate, that is what I want to do and how I do this layer is differentiated. The more we're using now is maven.

MAVEN defines the entire build process through its own set of semantics. I've only defined what to do, defined by the syntax of XML, but how I do it through an interpretation layer, but also in different languages, possibly on the Java platform, I use the Java language to implement, in the. NET platform, I use. Net.

One of the top-of-the-rack Facebook's thrift framework is this design idea, which defines a distributed service framework through its own set of languages, using its own interpreter to make the interpretation of its definition a different language implementation.

But because of the different rules and patterns of semantic definition in the domain language, for each domain, with its own DSL, such as Ant, I have to learn the whole ant rules, like Maven needs to start learning again.

At present, many language conversion services, such as the current Java-written language into obejct-c and Windows cloud services, the principle and similar above, should be converted into a set of intermediate language, and then transformed into the actual language of the features.

Future Imagination

With the rapid development of DSL language, I wonder if the future will unify the DSL, define a set of common rules and norms, find out the feature parts of each domain, abstract them, and form a unified development language. For example, Web programming, only need the DSL language of the Web, do not need to learn python,php,jsp,asp, and so on, in the database operation is the same, do not need to understand each platform specific connection database and code implementation, with unified data operation DSL can. This idea is bigger, is also a rip-off, but still hope someday, the programming language will be unified, but now more and more this trend, each language in the addition of other language features, enhance their own characteristics, the later languages have become more and more similar, the function is more and more identical, The only thing to consider is the language performance problem, but with the development of hardware, the performance of most applications at the language level should be ignored unless a particular domain is used.

Through the evolution of programming languages, the idea behind the start-up is the same, as I forgot how to say it, probably meaning: the complexity of any two systems can be masked by adding an abstraction layer. The evolution of the entire programming language also illustrates this problem.

The evolution of programming languages

Related Article

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: [email protected] 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.