preface

At 20:20 on May 22, 2021 (this Saturday evening), I have decided to write an article about lua language. So I just saw a column about the new features, so I opened the Lua Language learning column: Lua Language from introduction to practice.

I’ve been trying to write a lua tutorial for about a year; I got to know Lua language in 2018. When I just graduated for a period of time, I once again needed to implement the flow limiting function and illegal IP shielding in my work. Of course, you might think it’s simple redis, nginx; But it was in the process that I saw lua limiting; So I went to the official document to understand a wave, wow, I feel really very small, performance is better, plus OpenResty + Lua really is a perfect combination. Of course, go is also a language with superior performance. I love it too, hahaha ~~~

Anything is possible

Friends say since like that write cough up! Lua was born in the ’90s (1993) and unfortunately I don’t think I knew it existed at that time. Lua language is basically around the colleagues or classmates rarely know it, even before a colleague asked me: “What is Lua language? How do you spell lua? “; Well, I didn’t know what to say, so I said, “Call it L U A, please.” 😁 😁 😁

With the rise of the game industry and the live streaming industry over the past few years, Lua has gradually come into developers’ eyes; It can be imagined that such an obscure programming language after so many years of baptism is still tepid, accurate to say, it is too small; Colleagues who can’t guarantee their performance like GoLang, Java, and Python can do more business logic. But that doesn’t mean it doesn’t stand out because it’s small, does it?

Be confident: Anything is possibleCopy the code

PS: Thanks to the Nugget community for providing a Google plugin that shows the language recommendations on Github, which is a lot easier and a daily must-see.

Look on the bright side

The Lua open source community is small but github is very open about the Lua language. Basically, game companies and now the so-called dafa are all using lua language, such as: guangzhou sanqi interactive entertainment, guangzhou huya (c++, go), guangzhou kugou music, guangzhou wechat and bat more or less use some lua scripts. If you’ve been in one of these companies, you can feel it. Of course, with Docker + OpenResty, many communities started using Lua. It’s not a popular language, but it doesn’t hurt to learn Lua. The more you learn, the more you’ll discover you don’t know.

Look on the bright side -- always Look on the bright side!Copy the code

Batter late than never

Although it was 24 years since I first met the Lua language; Though long overdue; But not without my love for it. So recently, on my way home from work, I’ve been thinking about starting a new protocol; Write articles you like, interesting articles, articles with details, articles that are helpful to friends; Rather than purely as a learning record of the chapter. Amu learned Lua in less than three days and began to do projects and write scripts, but at that time, it was only the entry level, and after years of training, it was a lot of proficiency.

So from today on, let’s learn Lua from scratch; Amu a review of the basic knowledge points urged their need to continue to learn to consolidate knowledge, active learning of new knowledge new skills; At the same time, I also hope to share my accumulated experience with readers in the process of learning, and make progress together with my friends. The article will be more delicate, the middle may be interspersed with relevant knowledge, but be sure to read, it may be your blind spot, you ignore it.

Batter late than never!Copy the code

A promise is a promise

Lua language from introduction to actual combat column: for Lua language interest, beginners, programming hobby, is the player; This column will take you to the bottom of the Lua language, get you started, get you up in the pit, and get you in the action. With better luck, I recommend you to enter bat factory 😌 😌 😌

The target
  • ① Minority language has its own minority language, small, can be embedded, simple and easy to use; Quickly understand the basic knowledge architecture
  • ② Quick start, master the basic knowledge of Lua language
  • ③ Can write some function modules independently
  • ④ Can combine the learned knowledge and functional blocks, actual combat projects
Be conscious: A promise is A promise -- do what you say!Copy the code

conclusion

We have to do everything on our own, on our own consciousness. We can actually Try harderCopy the code

All right, I’m Amu, a worker who doesn’t want to be eliminated at 30 ⛽️ ⛽️ ⛽. Creation is not easy to feel “Amu” wrote a bit of material: 👍 to pay attention to, 💖 to share, we will see you next time.