Lua, what is Lua? [closed]

2019-03-17 17:55发布

I read something about Lua today, and I was wondering what it was.

I did a Google and Wikipedia search, I understood it until they began talking about C and API. I still don't understand it.

What is Lua and are there any tutorials for beginners?

标签: resources lua
10条回答
你好瞎i
2楼-- · 2019-03-17 18:25

Lua is a lightweight, embeddable scripting language. It's garnered a lot of popularity partly due to it's use in many popular games. A good example of this is World of Warcraft which uses an embedded version of lua to drive the behavior of the UI elements in the game.

A good intro to the language can be found here: http://computer-programming-languages.suite101.com/article.cfm/a_brief_introduction_to_lua_scripting

And the official online reference for the language can be found here: http://www.lua.org/manual/5.1/

查看更多
虎瘦雄心在
3楼-- · 2019-03-17 18:27

It's a scripting language that is designed to work with C (and C++). It is designed to be embedded into C/C++ programs. Which means unlike a lot of other scripting languages, it makes no use of global variables and such, this means you can easily thread lua scripting engines.

It also makes claims about being the fastest dynamic scripting language.

I've made use of it in PC based C++ application for creating a plugin scripting interface, and also used it as a embedded scripting language. Its quite versitile, nice and small.

as a general purpose scripting language? Its not quite in the same league as your ruby/python/perl type stuff. It doesn't have as many libraries and the user community is pretty small.

But for extending C++/C apps? its awesome.

查看更多
爷的心禁止访问
4楼-- · 2019-03-17 18:40

Lua is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

for more you can read here

查看更多
神经病院院长
5楼-- · 2019-03-17 18:41

Lua is a scripting language. Link is to lua.org. It is heavily used in game development, most notably (to me) World of Warcraft.

查看更多
兄弟一词,经得起流年.
6楼-- · 2019-03-17 18:42

Lua is a simple lightweight highly portable dynamically typed embeddable and extendable multi-paradigm scripting language. The "vanilla" (some would say official) implementation of it is made purely on ANSI C and has an awesome (simple yet powerful) C API that you can use to both embed Lua on your app or extend the behavior of the language itself. It is developed at the Informatics Department of the Pontifical Catholic University of Rio de Janeiro (PUC-Rio).

Thought it was not primarily designed for that, Lua found a big niche in game scripting, with big names such as "Grim Fandango" and "World of Warcraft". Nonetheless, because of its speed, simplicity and portability, it is also heavily used in embedded systems (see, for example, eLua project) and graphic computing.

Its philosophy is to be minimalistic, i.e its core libraries are very small with only minimum functionality (quite like C's standard libraries), though through the C API it is very simple to add features that wouldn't be possible through the pure core library, such as sockets, GUIs etc. In fact, Lua is so minimalistic that its main -and only- structured data type are 'tables', that could be described as associative arrays on 'roids.

Lua is procedural in its essence, but also supports multiple paradigms such as functional programming and object orientation.

Though Lua is not the fastest scripting language around (probably javascript's V8 project wins the prize) it is very fast (faster than vanilla Python or Ruby, for instance) and also features a non-official just-in-time implementation called LuaJIT.

In the end, Lua is actually no more than a fun language to play with, which I recommend!. =)

About tutorials, I'd recommend the article about that on the lua-users wiki.

I hope I helped! =)

PS: I couldn't post all the links because I'm new on stack overflow, but it shouldn't be hard to find everything on Google. Sorry. =(

查看更多
相关推荐>>
7楼-- · 2019-03-17 18:49

Lua is a scripting language for C and C++. It allows to use the simpler syntax of Lua and execute these scripts in your C/C++ application. Therefore you don't have to compile the program on each change, but simply deliver a new script version.

For tutorials just use google, you'll find enough to keep you busy the next days.

查看更多
登录 后发表回答