Version of Lua

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Nagbe
Prole
Posts: 2
Joined: Sat Mar 30, 2013 5:57 am

Version of Lua

Post 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. ^^
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Version of Lua

Post 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.
Shallow indentations.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 5 guests