Chapter XXXVII: The Poet and the Programmer
If someone asks you, is a poet related to a programmer?
Don't just say it's okay, although the two professions seem to be incompatible, in fact, poets and programmers are very closely related.
“If should see you,after long year.”
"How should I greet, with silence and tears", these two lines are famous lines of the famous poet Byron,
"After a long time, if you say goodbye, what greets you is my silence and tears"
You ask, poets have them, but what about programmers?
Don't worry, Byron's daughter, Ada Lovelace, was the first programmer in the world, her father was a great poet, and her mother was an amateur mathematician, she did not inherit her father's romance, but inherited her mother's mathematical talent.
Ada helped Babbage design the world's first computer, Babbage's analysis machine.
He also wrote the program of the first Babbage analysis machine, a program for solving Bernoulli's equation (coincidentally, Bernoulli's equation is the basis of fluid mechanics and the theoretical basis for all aircraft to fly into the sky).
What we use today for next, what do while including the concept of subroutines, all from Ada, magical no?
Ada, like his father, left in the prime of his life, and they only stayed on earth for thirty-six years.
God is jealous of talents, nothing more than this.
Wang Yinan sighed for a while about the relationship between the poet and the programmer, and was stunned by several programmers in the company and the flight control programmer of the 116 Institute.
The boss is the boss, a simple opening statement, and he was forced to make a flower.
He writes on the whiteboard
"Ada", three letters.
"Today, we're going to talk about Ada"
"Ada is a programming language used by the military of the United States, and it is also a programming language used by a large number of military enterprises in China."
"So it's okay to say that rabbits are the biggest beauty fans",
"Of course, there's nothing wrong with that", "ADA was designed to deal with the software crisis."
"In the sixties and seventies of the last century, due to the expansion of software scale, quality became more and more difficult to guarantee, and the rate of bugs increased even faster than the speed of software development"
"So with the software crisis, what is the myth of the human month, what rice has a free silver bullet and other works are all about this"
"Later, the Ministry of Defense of the United States specially designed a new language for these problems, which is Ada."
Wang Yinan said, "I think the most successful thing about Ada is that he answers a core question, what is it?"
"What is most important in software development",
"I think the priorities that the Ministry of Defense of the United States, which designed Ada, considered when designing the programming language design, are still correct to this day," Wang Yinan wrote three words on the whiteboard.
"Stability", "Maintainability", "Expressiveness"
"Stability is undoubtedly the most important thing, and if the program does not run stably, it is impossible for any military system to put it into practical use."
"Maintainability was neglected a few decades ago, but today there is a growing awareness of its important role, and the longer the life of a program, the more important maintainability becomes"
"It's easy to write a program, but a program is like life, it will interact with the surrounding environment, it will slowly grow, it will change, it will grow, it will mature, and it will grow old."
"Many programs have a lifespan that exceeds the life of a person, so different people will come to maintain it, modify it, and first read it"
"If you can't read, how can you grow up? Readability is the most important part of maintainability."
"Expressiveness is what I summarized, although theoretically the expressive ability of any programming language is equivalent to a Turing machine with only two commands, forward and backward."
"But language ability is still reflected in unambiguous, concise, clear, etc., so the earliest design goal, which is close to natural language, is understood by me as expression ability."
"I have to say that the Ministry of Defense of the United States is still very strong"
"The Ada language is at least 30 years ahead of industry"
"While the industry is still racking its brains to exploit the performance of each clock cycle, maintainability has been placed second only to stability"
"That's why 116 chose Ada as the development language for the flight control system, which was very visionary."
Li Wenjing raised her hand in the audience, "What you said is very good, very correct"
"But what do we do next?"
"Shall we rewrite the flight controller in the language understood by the Gödel system?" Li Wenjing had not finished his words when he heard a loud voice, and several programmers of the 116 Institute foamed at the mouth and collapsed in their chairs.
"Or do we write a compiler that compiles the flight control system written in Ada into a language that the Gödel system can understand",
The sound of babbling sounded again, this time it was Zhao Tiancheng and Li Fei foaming at the mouth and slumping on the chairs.
"Good question", Wang Yinan pointed to Li Wenjing, "Very good question",
"How else can we say that we are the best partners?"
"That's thanks to our great open source cause"
"There's an open source project called LLVM, does anyone know?"
Immediately, several people raised their hands, and Wang Yinan pointed to a programmer from the 116 Institute, "Let's talk about it."
"LLVM stands for Low Level Virtual Machine, which is actually a collection of specifications and tools that provide a very powerful foundation for developing compilers for existing languages, and even for designing new programming languages."
"Perfect", Wang Yinan praised.
"Does anyone know about DragonEgg," Wang Yinan asked.
This time, no one raised their hands, Li Wenjing raised his hand and said, "Dragon egg wow, who doesn't know this"
Without waiting for Wang Yinan to scold, Li Wenjing sat down, "Just kidding, liven up the atmosphere."
"This is the backend of GCC, or the front-end of LLVM, which can connect GCC and LLVM," said Wang Yinan.
"You all know about GCC"
"Nonsense, don't insult our IQ, okay", "GCC is a set of open source compilers, including C/C++, Fortran, and of course, the Compiler of the Ada language, which we currently use in 116"
"Okay, let's live", Wang Yinan clapped his hands. He drew a circle on the board and wrote it inside
"116 flight control code",
"How many lines of code are there", Wang Yinan asked the siege lions of the 116 institutes,
"About four million."
Secretly swallowing a mouthful of saliva, Wang Yinan added the words "4 million lines" to the circle.
Then draw another circle next to it, write "GCC" in it, and draw a line with an arrow, pointing from "116 flight control code" to "GCC".
"In this way, everyone can understand that GCC can compile the flight control code of the 116 Institute," Wang Yinan said.
"That's fine, we also use GCC to compile the machine code used by the flight control computer," said the siege lion of the 116th Institute.
Wang Yinan drew another circle on the side of the "GCC" circle, and then wrote the word "dragon egg" on it.
"The dragon egg is the thing that connects GCC and LLVM," said Wang Yinan.
He added an arrow line to the "GCC" circle leading to the "Dragon Egg", and then added another line with an arrow to the "Dragon Egg" circle.
At the point where the arrow pointed, Wang Yinan marked a big question mark.
"Do you understand," Wang Yinan asked.
Everyone shook their heads, "The author is big, the concubine really doesn't understand"
Wang Yinan pointed at Zhao Tiancheng and Li Fei,
"We used LLVM when we were developing the Gödel system, do you remember?"
"Of course, I remember that part of the core of the Gödel system uses the IR of LLVM",
"Wait", "IR" (Intermediate Represention), is that generic intermediate representation that can be output by LLVM and understood by the Gödel system? “
"Bingo", Wang Yinan snapped his fingers,
At that big question mark, he wrote the two big words IR heavily.
"In this way, the whole process is all clear, and we don't have to rewrite the code of the flight controller", the fallen siege lions of 116 immediately sat up.
"There is no need to write a compiler", Li Fei and Zhao Tiancheng were also resurrected with full blood.
"Using these existing toolchains, we can automatically compile the flight control code of 116 Institute into the intermediate code of LLVM."
"What we have to do now is just to correspond these intermediate codes to the theoretical model we established some time ago, and add the necessary input and output modules."
Add virtual models and code of the actual control surface
"Then, you can train the Gödel system with tons of data."
"Simple is not simple, perfect is not perfect?" , Wang Yinan obviously got himself high again, according to his assumption, now it should be everyone shouting "perfect, simple",
Of course, if there is an acquaintance who says "Long live Wang Yinan", it will be even more perfect.
"Let's work", Li Wenjing slapped Wang Yinan's fantasy.
"We are the best at writing code, so if you can work hard, you can get the overall framework out first, and we will be responsible for supplementing"
"The boss is mighty", this time, even the programmers of the 116 Institute shouted behind the buttocks, "The boss is mighty!" “
Wang Yinan thought about it for a while, indeed, the overall framework, there are more people and it is really not useful, it is necessary to ensure the consistency of thinking, let others do it, he is really not at ease, and the progress is not guaranteed.
"Well, give me three days and I'll give the world a miracle"
"Let me show you the legendary Carmack. "Wang" (Carmack is the developer of Doom and is known for developing game engines independently, and he has written three generations of Doom game engines by himself)
Wang Yinan locked himself in a separate office and forbade anyone to disturb him.
The phone was also turned off, and a refrigerator in the office was a must, so he asked people to carry a box of Sprite and a box of instant noodles into it, and blackmailed Zhang Qi's house with a set of stereos worth hundreds of thousands, and he said this on the phone, "If there is no audio, I can't do the work, I can't do the work, the things of the 116 institute must be smashed, and the things of the 116 institute will be smashed, and the company will not be able to open, you can do it yourself."
For three days, the sound of heavy metal rock could be faintly heard throughout the company.
Three days later, the door opened, Wang Yinan walked out with a stubbled beard and a haggard expression, and said to Li Wenjing and Zhao Tiancheng outside the door,
"I just committed a version in git, you see, all the documentation is in the /doc directory"
"All sample code is in the /samples directory"
"You call the siege lions of the 116 institutes to study together, and I'll go to sleep."
"Eight hours later, everybody's on board!"