#Hello World in Lua

<div class="text-success lead">
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.
</div>

<img src="./logo_lua.jpg"/>

##Installation

Download the current Lua version 5.1.4 by typing:

<pre class="minicom">
~# wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
...
~# tar xvzf lua-5.1.4.tar.gz 
...
</pre>

Probably you need to install <b>make</b> to compile the Lua sources by typing:

<pre class="minicom">
~# apt-get update
...
~# apt-get install make
...
</pre>

Change into the Lua directory by typing:

<pre class="minicom">
~# cd lua-5.1.4 
</pre>

and install the package by typing:
 
<pre class="minicom">
~/lua-5.1.4# make posix
...
~/lua-5.1.4# make install
...
</pre>

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

<pre class="prettyprint">
io.write("Hello world, from ",_VERSION,"!\n")
</pre>

To launch it type:

<pre class="minicom">
~/lua-5.1.4# src/lua test/hello.lua
Hello world, from Lua 5.1!                                                      
~/lua-5.1.4# 
</pre>

##Related links

<ul>
<li><a href="http://www.lua.org/">Lua official website</a></li>
</ul>

##Credits

Thanks to <b>Claus Kuehnel</b> (<a href="http://www.ckuehnel.ch/" target="_blank">www.ckuehnel.ch</a>) and <b>Daniel Zwirner</b> 
for the contents of this article.


