Lua学习系列

Posted 牛顿的小脑

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Lua学习系列相关的知识,希望对你有一定的参考价值。

从现在开始,打算学习一门新的脚本语言-lua.

1.什么是lua?

   a) lua1

• Lua 1.0 was implemented as a library, in less then 6000 lines of C

• “The simplest thing that could possibly work”: compiler used lex and yacc, simple stack based virtual machine, linked lists for associative arrays

• Some of the syntax still lives in the current version:

• Lua 1.1 just added a reference manual, and a cleaned-up C API

      b)lua2

• From Lua 2.1 (February 1995) to Lua 2.5 (November 1996)

• Object oriented programming via delegation

• Pattern matching in the standard library

• Hooks for writing debuggers

• First users outside Tecgraf, with papers in Software: Practice and Experience and Dr. Dobb‘s Journal

• LucasArts begins using Lua in games

  c)lua3

• From Lua 3.0 (September 1997) to Lua 3.2 (September de 1999)

• Anonymous functions and a restricted form of closures give better support for functional programming, which would mature in Lua 5

• Major refactoring in the source code

• The next version brings big changes to the C API, so some applications from this time still embed this version of Lua

  d)lua4

• A single version, Lua 4.0, released on November 2000

• C API completely redone, using the stack model that we will see in this course

• An application can now have several independent instances of the Lua interpreter

• The standard library has been rewritten to use just the public C API, reinforcing the separation between the core and the standard libraries

  e)lua5

• From Lua 5.0 (April 2003) to Lua 5.2, the current version, released December 2011

• Maturity of the language, and the release of the “Programming in Lua” book

• Several big changes: metatables, true lexical scope for anynonymous functions, the module system, coroutines, lexical environments…

• Changes in the implementation: more efficient register-based virtual machine, replacing the stack-based one, an incremental garbage collector for shorter pauses

• The implementation now has around 20.000 lines of code, 3x Lua 1.0

  f)lua today

• Current license is the MIT license, free for both non-commercial and commercial use

• Open language, but closed development: new releases are still the responsibility of the three original authors

• Big community participation in the lua-l mailing list and the lua-users wiki

• A package manager, LuaRocks, and alternative Lua implementations: LuaJIT, JVM, .NET, javascript...

• Several frameworks for developing mobile games: Corona, Gideros, Codea, MOAI...

2.lua应用在哪里? 

以上是关于Lua学习系列的主要内容,如果未能解决你的问题,请参考以下文章

逻辑运算 — 白话Lua系列零基础教程 第四期

Nginx+lua+openresty系列 | 第一篇:openresty介绍

redis 学习系列08Redis小功能大用处02 Pipeline事务与Lua

快速体验,学习lua(一种可嵌入c++,c#,android,object-c等并进行互调支持热更新的脚本)的入门调试系列

白话Lua系列零基础教程 — 初识Lua

函数 — 白话Lua系列零基础教程 第六期