Page 1 of 1

Version of Lua

Posted: Sat Mar 30, 2013 6:07 am
by Nagbe
What version of Lua can be used with Love2d? I'm new to Lua and Love2d so I'm kind of clueless on were to begin :huh:. Any extra advise will be greatly appreciated. ^^

Re: Version of Lua

Posted: Sat Mar 30, 2013 6:40 am
by Boolsheet
The official binaries of LÖVE use Lua 5.1. It can't do 5.2 at this point. However, you may find LuaJIT builds here and there. One example is the love package on Arch Linux.

If you want to find out what interpreter version is running, you can look at the global variable _VERSION.

Code: Select all

print(_VERSION)
Or a little more verbose.

Code: Select all

io.write(_VERSION)
if jit then
	io.write(" - ")
	if type(jit.version) == "string" then
		io.write(jit.version)
	else
		io.write("LuaJIT")
	end
	if not #setmetatable({},{__len=function()end}) then
		io.write(" with 5.2 compatibility")
	end
elseif _VERSION == "Lua 5.2" and loadstring then
	io.write(" (5.1 compatibility)")
end
io.write("\n")
The Lua Reference Manual describes the language in great detail. It is a bit of a dry read, so you could also take a look at Programming in Lua. The 5.0 version is slightly outdated, but the basics of Lua didn't change and it's available for free online.