Let's take a look at the compilation principles (Hu Shu ).

Source: Internet
Author: User

Although I have learned the compilation principle while I was reading, I have been reading the compilation principle and the Lua source code for the last few nights because I want to learn the state machine, compared with the school, it is another way to understand the compilation principles. In the past, I learned the compilation principles in two ways: one is not understandable, and the other is not likely to design a language by myself, so the main goal is to take the exam. However, the compilation principle is actually another kind of feeling: first, our technology regresses, and the more we understand the compilation principle, the more we feel, second, many methods that I have understood in the past are either incomprehensible or incorrect. In short, after reading the compilation principle, I felt that I had moved myself back to cainiao. My previous vision was too narrow. I also bought the third edition of longshu, and I plan to understand it recently. In fact, many ideas on the Compilation Principle can't be discussed, because this is too esoteric. There may be 100 people, 50 people feel the same, and the other 50 may feel 50. For example, I am engaged in Motion Control. I have seen a lot of methods that I did not know in the past, and I know that many parts of the past are wrong. The understanding of the state machine is not as superficial as it used to be. Lexical analyzer is only one aspect. I think that the overall compilation principle is to explain how to create a state machine, to understand the compilation principle, we can at least build a state machine framework. Let's talk about some of my other tips. If it is still wrong, you should joke with everyone.

 

1. c is great

It seems that this has nothing to do with the compilation principle. It is true, but since I read Lua and Hu Shu, I understand one thing. The original code can still be written to this level, the habits I developed in the past have led me to think about how to encapsulate the so-called "object-oriented". I am too superficial. Maybe I can, but there is no way to be so small and there is too much recursion, there are too many pointers, too many beautiful data structures, and the reusability is just a good ttmd. I want to swear, at least I can't write such beautiful code. In the past, chatting with people and speaking languages were not very important. Algorithms and frameworks were the most important. In the past, right was a fart (but I believe there must be a lot of people ), that's why I still don't really know the language (don't fall in love with your brother, brother is just a legend). Let me say this, it's not that you don't understand structured programming, it's not really so good for object-oriented, the reason why you don't need structured programming is because your level is not enough and it is still too bad. Object-oriented solution is not efficient. It just makes development look like this. In addition, there are too many people with poor levels. If you don't need object-oriented boss, it's hard to make money, there is also the need to improve productivity. For at least a few decades, I think the C language will be the ancestor of all languages and there is no way to shake its position. Everything is just a clown. As far as I can see, C is the language closest to the compilation principle, C ++ is ordinary, and C is great. Compared with Java and C #, there are few companies that advertise C! That's all.

2. recursion is a programming tool

At the very least, my college teacher did not explain what recursion is. I still don't understand it. Can someone tell me what it means ?! Some people have summarized a dozen recursive forms in codeproject. Some books are also called specific mathematics. Unfortunately, they are all metaphysical. recursion is an idea.

3. Mountains and non-mountains, water and non-water

In the past, when we understood the data structure, the first thing we thought of was the memory. After reading the compilation principle, I understand the data structure and can also be used as a process. It is more important than that. This is also an idea. Maybe I was too fond of it. This is a post posted on the Forum two days ago. The address is

Http://topic.csdn.net/u/20090829/22/17d38974-2743-4a32-ae6f-2ec091484f39.html

My code is as follows:

# Include "stdafx. H "<br/> # include" stdio. H "<br/> int numdivide (INT num, int nfactor); <br/> int main () <br/>{< br/> numdivide (6, 3 ); <br/> getchar (); <br/>}< br/> int numdivide (INT num, int nfactor) <br/>{< br/> static int numfirst = num; <br/> If (numfirst = num) <br/>{< br/> printf ("Num: % d/N ", num); <br/> printf (" nfactor: % d/N ", nfactor ); <br/>}< br/> If (numfirst-num + 1 )! = Nfactor) <br/>{< br/> printf ("% d", 1); <br/> numdivide (-- num, nfactor ); <br/>}< br/> else <br/> {<br/> printf ("% d/N", num ); <br/>}< br/> return num; <br/>}< br/>

I think this program is describing a tree, generating a tree, and finally according to the results of this tree, this is what I understand after reading Lua and compilation principles.

4. It would be a pity that no one has ever done protocol programming.

This is what I said to the R & D manager of my previous organization. I think that for general people who are not compilers, the Protocol makers and compilation principles have recently come, of course, the level of programmers who often do protocol is higher than that of programmers who do not do protocol.

5. disadvantages of Hu Shu

It's big and incomplete in many places. Of course, it will be much helpful if you can combine specific Code such as Lua code.

 

 

It's a big joke, but it's still quite fun. You have to wait for anything wrong. In the past, I wrote a story about martial arts novels: "I am ignorant of children, and I dare to say anything about swordsman ."

 

 

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.