If programming is in Chinese?

Share
/ 2019-08-12 / News

The reason why I want to write this article is because I saw this hypothesis in the headline yesterday, but there are many answers in the answer that make people laugh and cry. Some seemingly tall but actually very outrageous answers actually have a lot of people to like.

Someone said that a Chinese character occupies two characters, one English letter only occupies one character, so use Chinese code to waste space After converting to binary 0101, the bloated execution efficiency is low and wastes space.

Some people say that Chinese characters are too complicated to arrange, too many possibilities, and the Chinese word is very common., the computer will be very difficult to understand, it is easy to produce ambiguity, English is much simpler.

More people say that they are tall,China pays attention to "one life two, two students three, three things", then China's computer is more likely to use ternary, or even eight-inch octal to replace the binary.

If you have learned the principles of computer composition and the principles of compilation, you will know that these answers are very outrageous. Because of professional relevance, let's talk to everyone about this issue.

First, we need to understand that today's computers are binary computers. Binary means that the brain of our computer (CPU) only knows the two numbers 0 and 1. Other things don’t know it, whether it’s 2345 or we’re on a computer phone. The picture video software seen in them, they will eventually be converted into a bunch of 0101, this 0 or a 1 is called a bit,Eight bits make up one byte (byte). For example, a 100KB image is 100*1000=100,000 bytes=800,000 bits, which means that in the eyes of the computer, this 100KB picture is one of 800,000 0101 String things.

Why do we have to use binary 0101 to represent these things, instead of using the more common decimal 0123456789 for humans, the decimal number contains obvious information More than binary, so it is more convenient to express it? Mainly because decimal in the machine to achieve far from binary convenience, you have to let the computer know 0101 always have to use different things to represent these two basic What's the matter? If you only distinguish between two states, it's too simple. You can find two states of natural opposition everywhere in nature, such as yin and yang, men and women, black and white, and so on. If you want to use the machine inside?The easiest thing to think about is the switch, which makes a switch in the machine. When the switch is turned on, it means 1, when it is off, it means 0, which is simple. If you use one thing to represent 10 states at the same time, then it is much more troublesome. Someone used to use the ten positions of the gear to represent the 10 basic numbers in decimal, but the problem is complicated and it will collapse directly. So the consensus that everyone formed later was that if you want to make a stable computer, you must use binary.

Now we refer to computers, and most people will feel that the thinking and design of computers are all things in the middle of the 20th century. Actually not, as early as the early 19th century,UK There is a scientist named Babbage who proposed a model of a modern computer, which he tried to make such a computer throughout his life. But he failed. The reason why he failed was because his thoughts were too advanced at the time. Not many people could understand it, but more importantly, the precision of the machine he was in was not enough. Because there was no In the electronic age, the computers he made were all mechanical machines, which could only be realized with things like gear switches, but no matter how sophisticated mechanical gears were opened, they were too rough in the eyes of modern computers. His failure is inevitable. The advanced computer model he designed can only be realized in the era of electronic age, and this is a century.

The reason why computers can be realized is that the diodes appeared in the early 20th century. A diode is a very simple thing that uses the characteristics of a semiconductor to do this: it only allows current to pass through it in one direction. So we can imagine the diode as an electrical switch: when you give it a high level, the current can pass through the diode, then the switch is open; if you give it a low level, then the current cannot pass the diode At this time, the switch is closed. Using this feature, we can use the level of the level to control the closing of the switch, and if the switch is turned on to indicate 1, the level is 0, so that we can use the level of the level to represent the binary two numbers 1 and 0. Instead of using a gear or mechanical switch to represent the binary 01, this is the basis for the implementation of the computer. Subsequent transistors, transistors, and even integrated circuits are only physical technological improvements.

Understand the origin of the computer, and then start programming.The computer is definitely not built. If you want the computer to do things for us, we must "tell" the computer what he wants to do, but how can I tell? Do you understand what you can write? Of course I don't understand, because I already said that the computer only knows 0101, and the others don't know each other. So if you want to communicate with the computer, please use 0101 to communicate with them. The first programming was like this. They played all kinds of empty space on a long paper tape. The punched representative 1 and the non-punched representative 0. The computer read the string of punched tape. I identified a series of 0101, and then he went to work.

Note that things haven’t appeared in Chinese encoding English code now, The current programming uses punched tape, which Obviously not the language of any country. That is to say, the main reason for the mainstream programming language is English rather than Chinese. Now that you haven’t arrived yet, you need to continue to go down.

Going down is the era of human beings. It’s cool to call the 0110 computer directly, but people are not good at it. If you want to write a program, you have to write a bunch of 0101. It’s too hard to write and it’s too easy to read, and it’s too easy to make mistakes. It is a problem to write 0 as a place, so humans have to find a way to be lazy. People will use these simple 0101 strings that are used in programming to express them in simple English letters. For example, "1000100111011000" was replaced by "mov ax, bx" according to the convention.When you execute the program, you can use another program to change these letters to 0101 according to the rules. This program is called compiler, because the latter language is called assembly language , so this program is called assembly compiler.

The first time we found the figure of English letters, why is the assembly language written in English? When the idea of assembly language became popular, Everyone agrees that they must abandon the 0101 machine code that afflicts the dead, and then the manufacturer of the processor directly expresses the instructions of the various operating processors in assembly language, so that you can use these assembly languages directly. The instructions are written to directly control the processor. Because Intel is the king of the processor field, you have to use theIntel processor to use the assembly instructions it specifies. Intel is a US company, so he writes these in English. The instructions are very normal.If the processor's hegemony is a Chinese company at this time, and the Chinese company replaces these 0101 with specific Chinese characters, then the same can form the Chinese character instruction set. Therefore, the language used to compile this layer mainly depends on the language used by the company that produces the processor.

The times continue to move forward, and people continue to be lazy. Although assembly language seems to be much more comfortable than something like 0101, it only translates the 0101 thing one word at a time, but its thinking is still machine thinking, not in line with humans. Your own thinking habits. This feeling is like letting a British person read "Chinese can you up, no zuo no die", which is definitely a fog. So people have to continue to develop a language that is more in line with human thinking. After all, writing a program is that people are not machines. It is definitely easier to write programs in a language that suits their own thinking.So after the assembly language, there have been a lot of more advanced programming languages. Let's take the famous C language as an example.

How good is the C language? I just give you an example and you will understand: Now mainstream operating system, whether it is Windows , Linux, Unix or Android IOS, it is written in C (some in some special places also contain some assembly). How does the C language work? Do you recognize the processor of a computer in a new language?C language of course does not recognize, but you do not recognize assembly instructions, then I use C language to write a program and then use a software to translate C language into assembly language for you to implement is not. In fact, it does the same. The thing that translates the C language into assembly language is called the compiler.

The problem is simple. The reason why the C language is written in English is because the person who invented the C language is an American, he invented the C language. Then you can get a compiler that can translate C into assembly language. So we see that the core of the problem is actually in the compiler. As long as you are happy, you can define a set of programming languages at will, define a set of grammars, and you can also let people write programs in Chinese, but if you want to let you The new language of the invention works, you have to give him a companion compiler, and use this compiler to translate the language you invented into assembly language. The College of Computer Science has a very important course called Compilation Principles, which is to teach you how to develop compilers.

So, we know that developing a new language is very simple, just you need to define a set of grammars yourself, and then get a compiler. The real difficulty is to promote, why do others use the language you develop? If the language you invented does not have any special advantages, why should I leave the original familiar language without using yours? Unless you can be as hard as Apple: Don't want to develop an iOS app to make money? If you want to use it, use my language honestly, don't talk nonsense. The C language is so powerful, why did it become popular in the 1990s? Because Java programming is much simpler than C, this simple meaning is the Java compiler. I have translated a lot of network related things for you, so you have to do a lot easier.

So, it is possible to develop a programming language in any country's language at this level. Chinese, English, French, and German are fine. Very simple, as long as you get a compiler out of the package.In fact, easy language is a programming language developed in Chinese.

Speaking of it, it’s easy to go back and look at the beginning of the question. No matter which country's people first invented the computer, the era of 0101 punching is the same. Then, in addition to the assembly language to be bound to the manufacturer of the production processor, other high-level languages are very free, these high-level languages do not have any restrictions on whether you write in Chinese or English, and our current mainstream programming language also These are high-level programming languages, and there are very few direct use of assembly language. The reason why the mainstream programming languages are now English,Mainly because the inventors of these high-level languages speak English (mainly Americans).

As for those who say that Chinese programming languages take up a lot of space or that Chinese semantics are difficult to understand, they are all wrong. Regardless of the language you are using, these languages are compiled into assembly language before execution. The space you write takes up a bit has no effect on the execution of the program. To say that Chinese semantics are difficult to understand, it is necessary to understand that the high-level language you write is not a processor, but a compiler that you write yourself. If you use your language, it will cause ambiguity, which only means that the compiler you wrote is seriously unqualified. This has nothing to do with Chinese and English.

Finally, if you want to design your own programming language, go to learn the principles of compilation.

Relevant articles recommend

Top suppliers

Response Time

24h

Response Rate

0%

Product:IC, CAPACITORS DIODES LED ....
1YRS

Response Time

24h

Response Rate

100.00%

Product:Photo Coupler,Optocoupler,IC,TOS,ON,AVAGO,SHARP,RENESAS,CT,EL,LTV,TI,NXP,ST
1YRS

Response Time

24h

Response Rate

100.00%

Product:Infrared Receiver Module,Infrared Emitting Diode,Silicon PIN Photodiode,Silicon Phototransistor,LED,Silicon Photocell,Hall Effect IC,Photoelectric switch,Photoelectric encoder,IC.
1YRS

Response Time

24h

Response Rate

100.00%

Product:KSD301 KSD9700 thermostat thermal protector fuse sensor
1YRS

Response Time

24h

Response Rate

0%

Product:IC,PCB,module,capacitor,resistor,diodes,LED,LCD
1YRS

Response Time

24h

Response Rate

100.00%

Product:Electronics components,ICs,MCU,RS-485/RS-422 Transceiver
9YRS
Subscribe News

Enter your email address:

Hot News

Contact Us

+86-755-83536845

One to One Customer Service

17190417227