• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Lua学习系列(一)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

从现在开始,打算学习一门新的脚本语言-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应用在哪里? 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
nginx+lua+storm的热点缓存的流量分发策略自动降级发布时间:2022-07-22
下一篇:
Lua在Windows下的配置、安装、运行发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap