Hello World in Lua --- CORE9G25
Feature Hardware ref Linux Tutorials Debian Tutorials pinout

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


  Tel: +86-755-29638421  |    Sales Email: market@armdevs.com |  Support Email: support@armdevs.com | Gtalk: armdevs@gmail.com  
www.armdevs.com | Copyright @2013 - CoreWind Technology Co.,Limited