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.

Installation

Download the current Lua version 5.1.4 by typing:

debarm:~# wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
...
debarm:~# tar xvzf lua-5.1.4.tar.gz 
...

Probably you need to install make to compile the Lua sources by typing:

debarm:~# apt-get update
...
debarm:~# apt-get install make
...

Change into the Lua directory by typing:

debarm:~# cd lua-5.1.4 

and install the package by typing:

debarm:~/lua-5.1.4# make posix
...
debarm:~/lua-5.1.4# make install
...

The Hello World example is stored in test/hello.lua directory:

io.write("Hello world, from ",_VERSION,"!\n")

To launch it type:

debarm:~/lua-5.1.4# src/lua test/hello.lua
Hello world, from Lua 5.1!                                                      
debarm:~/lua-5.1.4# 

Credits

Thanks to Claus Kuehnel (www.ckuehnel.ch) and Daniel Zwirner for the contents of this article.

Documentation Terms of Use
The Acme Systems srl provides this Debian system development and user manual.
The origin of these doc came from the website: http://www.acmesystems.it
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons License

关注我们: 微博

销售邮箱:market@armdevs.com
技术支持: support@armdevs.com
销售电话: +86-755-29638421


核风在线支持>
在线时间:09:00-18:00
Copyright @ 2014 to 2020 - 核风智能技术有限公司