Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

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 with a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Lua 是一个很有特色的脚本语言,学习Lua首先需要搭建好环境。

这里给出Lua 5.3.5 在Ubuntu上使用源码安装的简单教程。

首先去Lua 官网下载最新的源码

http://www.lua.org/download.html

将其解压后可以看到如下文件

通过README我们可以知道如何安装。

在此打开终端然后执行

make linux

 

可能会出现报错,这个错误可以通过安装libreadline-dev 解决

apt  install libreadline-dev

编译完成后执行安装

make linux install

瞬间完成!

检查一下版本

OK

测试一下Hello World?

NICE

END