Interviewer: six meters: six meters, Eiko

Spring elder brother’s programming journey begins with copying books, even if it is now a rare programming master, spring brother still strongly recommend his copying books to learn programming method. Chun ge has worked for Yahoo, Taobao and Cloudflare, but the open source world is his love. Chunge is now fully committed to the new blueprint of OpenResty, and expects OpenResty to lead the “machine programming” revolution in the industrial and Internet industries in the future. It is a great honor for the Turing interview to have a dialogue with Brother Chun. Let’s have a look at brother Chun’s happy programming life.

Brother Chun, born Zhang Yichun, is the founder and promoter of the open source project OpenResty.

Spring elder brother's timeline (after graduation) in 2007 is my university graduation, joined China Yahoo search technology department. Yahoo China was already part of Alibaba. That job opportunity came from the open source sharing I was invited to do at PerlChina Beijing conference on the eve of graduation, which happened to be held at Yahoo China headquarters. At that time, I had the opportunity to get to know the search team of Yahoo China (also known as 4E team). In 2009, I was transferred to the Data Products and Platform Department of Taobao, and concentrated on developing taobao Quantum Statistics based on OpenResty with my colleagues, mainly for Taobao sellers. I left Ali in 2011 and moved to fuzhou, a strange southern city, with my wife (who was then my girlfriend) for a year of what I called "idyllic life," working on open source projects like OpenResty from home. In 2012, I was invited by Cloudflare to move my family to the Bay Area of the United States to work full-time on OpenResty open source development and the development and improvement of software system based on OpenResty's global CDN network. I left Cloudflare later in 2016 and started OpenResty Inc. in the US in early 2017. The company.Copy the code

Mother, Celeron and copy, my programming starting point

I first got into programming thanks to my mom. When she was in junior high school, I remember it was in 1999 when she was preparing for the computer level 2 self-examination, so her family bought a celeron 330MHz CPU machine, installed with Windows 98. She also got a copy of Tan Haoqiang’s C Language Programming textbook and kept it at home. Naturally, I played with the machine a lot, and the only application that opened with no idea what to do was the strange Turbo C programming environment. After double-clicking, the cursor flashed on the blue screen, and I had no idea what to do. It made me curious to see how it could be used, just like MS Word, AutoCAD, and other familiar applications.

After graduating from junior high school, I “stole” that “C language programming”, carefully read up. My mother was very opposed to me learning programming. She thought I was “not doing my job.” No one else knew how to program except my mom, so I had to teach myself. Because there was no programming concept at all, even if I began to hand-write word by word from the first page, I still had no idea what I was doing, and I felt very depressed. In 2000, I just started my first year of high school. At that time, my high school, Zhenjiang No.1 Middle School, gave us a textbook called “Computer Foundation”, which included the chapter on Visual Basic (VB). I think it looks much easier than C language, so I began to copy the VB chapter in this textbook. I reread and reread every time I copied a paragraph. After a few weeks of this, the basic concepts of programming became clear. So, went back to continue to hand copy the C language teaching materials, copy to about half of the time, I finally feel can not continue to hand copy. Then I got bogged down in the details of how to implement various linked lists and other complex data structures in C. In the winter vacation of senior one, I started writing Thinking in C++ by hand again. By the end of the winter vacation, I was familiar with C++, so I was no longer satisfied with Turbo C and started to play with more advanced ides like Borland C++ and Visual C++.

Looking back, copying books is my magic weapon to teach myself programming. Copying books is a learning method I discovered by accident. When I was in junior high school, I loved chemistry so much that I always pestered my junior high school chemistry teacher with all kinds of strange questions. However, the teacher could not help but lend me a textbook “Analytical Chemistry” that he used in college. I couldn’t put it down, but I had to return the books I borrowed, but I couldn’t digest them right away. So I copied them all summer, and I discovered the secret of copying books by accident — slowing down my reading speed so that I didn’t miss every important detail: eye, hand and heart.

In fact, you can copy not only books, but also code. Remember I just entered taobao, want to learn Nginx source code. So at work during the day, I copied C source on my Kindle and memorized it in my heart. Go home in the evening in the house pacing back and forth, in my mind repeatedly replay the day copy of the source code, until the fusion through, deep its secrets. This lasted for a month or two, and then the enlightenment came.

Teach machines the balance beam between problem solving, programming and gaokao

After I started, I became more and more interested in programming. As long as there is no class, I will go to xinhua bookstore to see some programming books. It was my favorite place to be all three years of high school. At the same time, school education for the purpose of the college entrance examination has become increasingly distasteful to me. I think it is a complete waste of time. Although I went to a key local high school, which also advocated so-called “research-based learning” and “quality-oriented education,” the pressure of the college entrance examination began in senior one. On the one hand, it is the great fun of programming, on the other hand, it is the exam-oriented education oriented by the college entrance examination, which makes me very painful, and I even thought of dropping out.

I then discussed with my grandfather how to solve the problem, because we are both grandparents and grandchildren and friends. He came up with an idea for me to find a way to combine programming with high school. I had to figure out how to combine it. My grandfather didn’t know anything about computers. Seriously thought for a long time, I decided to teach the machine to answer the college entrance examination questions. And to teach a machine, I first had to learn how to do it myself. This gives me a reason to continue teaching to the test.

Of course, teaching a machine to solve gaokao questions is obviously a big challenge for a high school student without guidance. Those sats are tough even for humans. I had to study a lot of difficult computer courses by myself, such as compiler theory, automata theory, expert system, artificial intelligence, and read some papers, such as qualitative reasoning and other research results.

One big difference between machine problem solving and human problem solving is that machines can’t use human intuition to help solve problems. For example, auxiliary lines in geometry problems, or other visual-based solutions, are not suitable for machines. Machines need precise reasoning, need to formalize everything. I had to study a lot of unconventional methods, because some of them used advanced mathematics knowledge and were not suitable for the actual college entrance exam. I remember that in my senior year of high school, I also defined a simple mathematical system that could beautifully prove the qualitative proof of any solid geometry without relying on any human intuition or auxiliary lines. Unfortunately, with my mathematical literacy at that time, I could only prove the internal compatibility of mathematical systems, but not the completeness. However, the college entrance examination questions collected at that time can be verified by the automatic proof system. (Only after I went to college did I have time to complete the code implementation of the proof system).

For me, the three years of high school are extremely rich, but also very hard three years. Of course, the college entrance examination results are not so ideal, I think, because the pursuit of depth and breadth can not be a good balance. Fortunately, the score of the college entrance examination is still higher than this line, should also be the bottom of the class at that time. My four years in Jiangsu University have been very fulfilling and enjoyable. I believe that I have truly put into practice the slogan of “research-based learning” of my high school Alma mater and found a path suitable for myself.

I am very grateful to my grandfather for his encouragement and inspiration, which enabled me to finish my school education, and also explored the moving and beautiful side of school education from the perspective of artificial intelligence and machine problem solving. This is something I could not have foreseen at first in any way.

College, stepping into the open source world

The most successful things in college are two things.

One is to continue learning the way in high school, teaching machines to automatically solve and prove various topics and problems of college courses, such as automatic analysis of nonlinear circuits, simulation engine of discrete systems, hardware design of instruction decoder to implement x86 CPU instruction set, automatic formal proof of computer programs, etc. In addition, I coded on a computer and tested the sATS problem-solving systems I had designed in high school but never had time to implement.

The other thing is to be exposed and involved in the open source world. To this day, I remember the thrill of writing my first email to an open source website. Although I just reported a clerical error, the maintainer of the website quickly responded and thanked me for my report, which made me feel ecstatic. In my junior year, I started following Perl 6 as an open source project and spent every day poring over their chats on the IRC channel on the Freenode server. I found that the way these “foreigners” spoke was very different from what I had seen in my English textbooks. There are a lot of idiomatic expressions, as well as some Internet slang. Through the chat logs, I mastered the spoken language of the open source world and got familiar with the temper and speaking style of the big talkers on the channel. After a year of serious diving, I started talking on that channel and gradually became involved in the community.

Since then, I’ve been actively working on a number of interesting open source projects, contributing to the Perl 6 community. In my senior year, I made a visual debugging tool for Perl 6 parsing and was praised by Larry Wall, the inventor of Perl. Larry commented on my tool in the IRC channel: “AgentZh: Please allow me to say I’m amazed!” There are all kinds of people in the chat channel, some are PhD candidates from an American university, some are programmers after graduation from an art school in the West, and some are heavyweight masters like Larry Wall. People with all kinds of personalities, backgrounds and cultures collide with each other and interact with each other. It was an experience I couldn’t get out of. The open source community and IRC have connected me to the world.

The college years are much more free and relaxed than the high school years. Both body and mind have been liberated unprecedentedly. The following moments impress me deeply.

  • During the day, I shopped for books in the abundant library of Jiangsu University. I was filled with awe and joy when I saw English textbooks of various subjects.
  • Working on interesting open source projects with hackers around the world in the open source community and online at night;
  • At night, I would go back to the boys’ dormitory and turn off the lights. Then I would go to the opposite dormitory and have a lively discussion with like-minded students about some interesting new ideas — usually related to science or technology, of course, but often interrupted by the old man on ward rounds. Even after I stopped living in the dorm, I would go there often.
  • When I was tired, I walked round and round in the beautiful and broad campus of Jiangsu University, thinking about one interesting scientific or technical problem after another. I had a heroic feeling of “birds fly in the sky and fish leap in the vast sea”.

Photo courtesy of Brother Chun

English, connecting the best programmers in the world

English is one of the prerequisites of internationalization. As mentioned earlier, the first time I connected with the international open source world through email, I truly understood the power of fluent English. If programming languages connect us with machines, English connects us with the world’s best programmers.

In high school, I mainly read technical and science books in Chinese. When I entered university, I only read English books. It must be admitted that the most advanced technologies are often originated outside China and written in English. Therefore, the Chinese version will lag behind the original English version greatly, and many relatively obscure fields can not even find the Chinese version; In addition, it may be due to the translator’s professional level and language skills that there are many mistakes in the Chinese translation. For example, Teacher Qiu Zongyan once translated the book Programming Practice. She bought it in her first year of high school and read it closely for several times. When I went to college, I was surprised to see the original English in the library, and had to feel that the original English was much clearer and smoother.

For the sake of internationalization, all the open source projects I’ve been working on since college have been written in English, with only a few cases where I add Chinese translation, because translation is really boring work for me. English served as a bridge to the rest of the world, and OpenResty’s subsequent internationalization benefited from this.

Work, the most difficult: with the right people

In the years since I started working, I have often received inquiries about work and internships. My personal view is that if you have the opportunity to work with a great person, you can gain a lot in whatever you do. It’s not the job that matters, it’s the person that matters. I’d give it up for the chance to work with someone I admire. Of course, this really depends on the chance, is a very rare thing.

After graduation, when I first joined Yahoo China, the work I did was often criticized by a more senior back-end engineer, the most severe one was “garbage batch manufacturing” such words. However, I learned a lot of implementation methods and design ideas of high-performance Internet application system piecemeal from him. Later, after joining Taobao, I worshiped an engineer who seemed very “god” at that time as a teacher. Under his guidance we built the second-generation OpenResty platform, and I learned a lot about C-based system programming.

On the other hand, there are really no barriers to entry in the open source world. As long as you work hard and want to, you have the opportunity to work with different world-class people, rather than being stuck in the same company. On the other hand, corporate environments tend to be more complex and far less simple and pure than open source communities (which, of course, have their own political battles, so stay away).

Therefore, I suggest students who are still in school embrace open source, preferably participate in international open source projects and join the corresponding international open source community. In my own experience, a job in the open source world is the best resume to have. After graduating from college, I almost never actively looked for a job. The jobs at Alibaba and Cloudflare in the US were all jobs. I’ve been at Ali for four years and Cloudflare for four and a half years.

Appreciate, learn and surpass the awesome people around you

I am often asked, who do you admire in the technology industry? I don’t like the word “worship” because I don’t want to worship anyone. Worship itself is irrational. There are a lot of great people I admire. I treat them as teachers and try my best to learn some essence from them and surpass them. Just name a few teachers.

In senior year of high school, I admired Perl’s grandfather, Larry Wall. Perl is unique in style and nature compared to other procedural languages because Larry brought linguistic and philosophical ideas to it. I loved the culture and philosophy of Perl, and it’s still my “mother tongue” in the programming world to this day.

In early 2012, FASCINATED by Brendan Gregg’s pioneering work in the field of motion tracking, I read a lot of his tech blog posts and bought his book to read. After moving to the US, he finally had the opportunity to put many of his methods and ideas into practice in Cloudflare’s global network, quickly locating countless online “weird issues” and sometimes even unexpected discoveries. Building on Brendan’s work, I explored and innovated further and went beyond that in some areas, extending flame mapping technology to new dimensions such as memory leak detection and off-CPU time analysis. Brendan even devoted a slide to my work in this area in one of his technical presentations.

Description: Brendan Gregg, Netflix Senior Performance Architect, noted Performance tuning expert, and author of Systems Performance: Enterprise and the Cloud (Chinese version, Top of Performance: Insights into Systems, Enterprises and Cloud Computing, Publishing House of Electronics Industry).Copy the code

In recent years, I have also been a great admirer of LuaJIT’s author Mike Pall. LuaJIT, the just-in-time compiler for the Lua programming language, is so clever in its design that I began to wonder if it was human at all (laughs). The email communication with Mike gave me a lot of inspiration, so EVERY time I received the email, I would read each sentence repeatedly, for fear of missing important hints. Sometimes, Mike would even recommend papers he thought were good for my reference.

Outside of code, read, swim and walk

Besides writing code, I enjoy reading books, including computer science, technology, mathematics, and Buddhist studies. During my years in the Bay Area, I enjoyed walking in the mountains and lakes and thinking about some difficult but interesting technical problems. For me, it’s a great treat. In addition, he went swimming almost every day and practiced early Buddhist meditation techniques in the evenings to achieve a wonderful sense of inner peace and joy. In my opinion, the original Buddhism is actually a philosophy, which is very different from the Later Mahayana Buddhism spread in China, which is really a religion and a theology (of course, zen Buddhism after Huineng has many similarities).

Life in the Bay Area is very close to my ideal of an idyllic life. My vision of “idyllic life” originated from an essay in my junior high school Chinese textbook titled “Fishing is Better than Fish”. In the article, an old professor of an American university often went fishing in a small boat in the mountains and lakes while researching academic problems. The fish he caught were often put back into the lake. Since my boyhood, such a life has been rooted in my heart and become my ideal living and working state.

Photo courtesy of Brother Chun

OpenResty, machine Programming Revolution “Horcrux”

OpenResty is an open source Web platform for developing high performance and dynamic Web gateways or Web applications. OpenResty was originally designed to support relevant search APIS around the whole web search engine. Later, we rewrote OpenResty based on Nginx and LuaJIT to support all data apis of Taobao Quantum Statistics product. Later, I joined Cloudflare, an American CDN company, and used OpenResty to drive the dynamic HTTP and HTTPS proxy system for Cloudflare’s global CDN network.

OpenResty has been open source since day one. Over the years, the OpenResty community has tried to use it in a variety of different business scenarios, some of which we couldn’t even imagine. For example, some companies use it to build the front-end and back-end of distributed network storage systems (such as web disk applications); Some use it to build complete Web applications, such as the generation of commodity details page of e-commerce platform and the Web management system of large-scale sports events; Others build large Internet advertising platforms or more complex Web API management systems on top of it. Others use it to power hardware boxes for small traffic scheduling, or to power home-based companion robots. Of course, it’s more about implementing Web apis that have a lot of traffic. It seems that all traffic related work has the opportunity to use OpenResty, and we also have users using authoritative DNS servers that are completely Based on OpenResty.

OpenResty has the advantage of being small, flexible and highly dynamic. Based on the Nginx event model and the coroutine of Lua, we implemented an efficient I/O scheduler based on I/O multiplexing, introducing powerful abstractions such as “lightweight thread” and “coroutine socket” (also known as COsocket). Lua’s dynamic nature makes it easy and secure to load and hot-replace and hot-unload code on demand at the request and connection levels. This capability is particularly critical in dynamic CDN scenarios, where hundreds of thousands or even millions of configurations of different sites are often handled, and these configurations may be in constant dynamic change, requiring high efficiency, even at the scale of the global network.

The new version of OpenResty we are working on will include many important new features, such as automatic queuing and waiting for new back-end connections when the connection pool is full, the ability for coroutine sockets to actively listen() and accept() at the Lua level, Efficient non-blocking pipe communication in Lua with standard I/O devices of newly created child processes of other system commands. In addition, in terms of performance, the inherent overhead of Lua handlers is significantly reduced, with the simplest Hello World interface seeing an overall performance improvement of tens of percent.

I have always had a big vision for OpenResty: I hope OpenResty will lead the “machine programming” revolution in industry and the Internet. Humans simply feed the machine industry knowledge and intentions, and the machine can write efficient and reliable implementation code, test it, and produce human-readable documents that can be deployed error-free on large-scale computer systems. Just as today’s manufacturing industry has seen robot assembly lines replace workers en masse, tomorrow’s programmers will be freed from business coding to do more interesting and creative work.

Caption from OpenResty Chinese community

Users are fueling OpenResty

OpenResty is growing rapidly and is powered by the large number of OpenResty users. This includes both my former employer and the wider open source community of individuals and businesses. I’ve received emails from users thanking me specifically for my work on the OpenResty project; I often receive donations from Chinese and overseas users. Perhaps most of the donations are not large, but it always warms my heart. Every year at the OpenResty Conference, I have the opportunity to meet OpenResty users, as well as community contributors and developers. Sharing inspires me to keep developing new gameplay and features. The OpenResty community is like a warm family, worldwide. The happiness generated by wide connectivity is similar to the daily #perl 6 IRC chat channel in college, except I became the “guru” of the old IRC channel!

In the past two years, we have established a non-profit organization in Hong Kong, the OpenResty Software Foundation, which is responsible for donation processing, support for the OpenResty conference, and awards for community contributors and developers. The OpenResty Software Foundation and The OpenResty Inc business are in a parallel relationship, operating independently of each other.

Business level technical support and solutions, OpenResty Inc

I have always had high hopes for OpenResty. I wouldn’t be able to fully focus on the OpenResty blueprint if I kept working for other companies and selling my time. Although my previous employers have been supportive of my work at OpenResty, it is a matter of basic professional ethics to ensure that the business needs of my employer are first and foremost paid for.

In addition, as OpenResty penetrated more and more companies and industries, the community was unable to provide commercial-level technical support and ideal solutions. This is a common limitation of open source projects.

When WORKING at Taobao, I have successfully practiced a method of constructing complex business software system, namely, teaching machines to write programs, which has greatly improved the construction speed of complex business system, and meanwhile improved the quality of the system in terms of understandability and operation efficiency. So, FOR a long time, I wanted to have the opportunity to promote this revolution in machine programming in industry. Apparently, teaching machines to write programs was inspired by an interesting experience I had in high school teaching machines to solve college entrance exams. These experiences inspire and promote growth in ways we never expected.

Then one night in 2016, I had the idea to commercialize OpenResty, using the power of commerce to bring together like-minded members of the OpenResty open source community to form our own team. Of course, the open source nature of OpenResty will never change. Based on OpenResty, the company builds upper-level commercial products and commercial solutions for enterprise users with high requirements and challenges. While the commercial version of OpenResty may have some advanced features that the open source version does not, as technology continues to evolve, more and more commercial features will be ported to the open source version for the rest of the world to enjoy.

OpenResty Inc is positioned as an enterprise oriented software services company that wants to explore new ways of building and optimizing future Web systems. We sell enterprise-level server-side software and services, providing enterprise customers with OpenResty and Linux-based technology solutions. With a new approach to “machine programming,” OpenResty Inc has dramatically improved the speed and quality of complex application development. My work experience in the Internet industry makes me clearly realize that the traditional software engineering approach is increasingly unable to meet the needs of increasingly complex business software systems. Letting machines automate the complexity of business software is the way to go!

“Machine programming” is a big world, and our current starting point is small: build and sell OpenResty Edge, a highly flexible distributed traffic management software, in a “machine programming” way. Our current commercial customers include large-scale CDN vendors, large websites that build their own CDN, and use our software for website traffic entry, that is, to run behind the CDN network and distribute traffic to different back-end lines of business systems. We provide document-like “small languages” that allow customers to express complex business requirements and business logic directly in business languages rather than programming languages, and then our products automatically generate various types of highly optimized code to run on a larger cluster network.

Our company also plans to launch a distributed dynamic tracking platform this year, called OpenResty Trace, that will allow you to do all sorts of interesting performance analysis and Bug tracking on large, distributed Internet systems without having to work with an application or go offline or restart any online services. It is equivalent to taking a live X-ray, or MRI, of an online software system. You can see everything from the operating system kernel to the scripting language code of the application software anytime and anywhere, viewing the entire software stack as a whole that changes dynamically over time. Naturally, “machine programming” and “machine reasoning” methods and techniques are used extensively.

The number of entrepreneurial challenges

There are many difficulties in the process of starting a business. The first was a huge shift in roles. I went from being an employee to an employer, from a worker to a boss. This requires a very big adjustment in the way of thinking and doing things. I also need to learn a lot of things that I have never been exposed to, such as financing, corporate equity structure, corporate finance, taxation, legal affairs, intellectual property rights, sales and commerce, etc.

Secondly, OpenResty Inc is a “multinational company” since its establishment, straddling China and the United States, which involves cross-border capital flow, regional establishment and distribution of intellectual property rights, tax requirements of different countries and many other issues.

Third, although we have an office in the Us Bay Area and an office in Zhuhai, most of our employees work remotely. How to make the team work closely and efficiently becomes a big challenge. On the other hand, it’s a great advantage for us to be able to recruit talent from anywhere in the world without having to worry about new employees moving and emigration. In addition, the freedom of working remotely can attract hackers who prefer a separate workspace.

Finally, this small theme is a special section, we invite spring brother to beginners programming friends, say a few words out of my heart.

Be brave and follow your own path

For those of you who are new to programming, I just want to encourage you to go your own way bravely! I believe that everyone has the most suitable growth path, while mainstream education and training always try to assimilate and streamline, which I hate most. Should be eclectic, their own way is worth sticking to. Mainstream technology and ideas are always changing so fast that there is no point in following them like a fad. I hope you will stay true to your original aspirations and keep your curiosity and interest in programming intact.

If I could go back in time to my early programming days, I wish I had installed periodic forced breaks on all my machines sooner. Plus, I would have gone swimming earlier and more often, so I wouldn’t have one of those programmer diseases (like neck pain) today. In addition, I wish I had spent less time in high school thinking about proprietary technologies from major software vendors, such as Microsoft OLE, COM, and COM+ (I don’t think many of today’s younger generation of programmers have heard of these terms), and had embraced the open source world and open source technologies earlier. Finally, I hope THAT I can further study and research in theoretical computer science and peripheral mathematics. As I moved into industry, I realized that these fundamental theoretical studies were the foundation for the pursuit of “extreme programming” and solving the most difficult industrial problems, which are most often overlooked and ignored by the average engineer.

Photo courtesy of Brother Chun