Lua

1 program Added 2025-10-22T09:35:36Z Model: meta-llama/llama-3.1-70b-instructTemp: 0.4 Evidence Report issue View issues
Aliases: LuaJIT
Provenance: commit 9a9aed04d1 · authored 2025-10-22T11:35:36+02:00 · model meta-llama/llama-3.1-70b-instruct

Sources mentioning this language

8 sources · pl_id: pl/lua
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q207316

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: scripting · imperative (procedural · prototype-based · object-oriented) · functional · meta · reflective
Typingdynamic, strong, duck
Designed byRoberto Ierusalimschy Waldemar Celes Luiz Henrique de Figueiredo
First appeared1993
Influenced byC++ · CLU · Scheme · SNOBOL
LicenseMIT
Implemented inANSI C
Homepagehttps://lua.org

Extensions claimed by this language

14 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.anairwikidataprimary
.lualinguistprimary22.8M files
.luapygmentsprimary22.8M files
.luawikidataprimary22.8M files
.lunawikidataprimary4.0K files
.lunairewikidataprimary
.fcgilinguistsecondary11.6K files
.nselinguistsecondary15.6K files
.p8linguistsecondary86.5K files
.pd_lualinguistsecondary
.rbxslinguistsecondary115 files
.rockspeclinguistsecondary64.8K files
.wlualinguistsecondary1.0K files
.wluapygmentssecondary1.0K files

Related languages

LuaJIT (0.69)Luan (0.23)Legit (0.21)Luerl (0.16)Lispkit Lisp (0.16)

LLM-contributed programs

Love2D Game Template

Provenance: commit 9a9aed04d1 · authored 2025-10-22T11:35:36+02:00 · model meta-llama/llama-3.1-70b-instruct · Temp 0.4
codemain.lua · license: MIT · added: 2025-10-22T09:35:36Z
function love.load() end
function love.update(dt) end
function love.draw() end
function love.keypressed(key) end
function love.keyreleased(key) end
function love.mousepressed(x, y, button) end
function love.mousereleased(x, y, button) end

Real programs from Software Heritage

3 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
LaunchInstall.lua · 1360 B · ext .lua · seen 18832× in SWH
via unique-primary
swh:1:cnt:0ca3acacf9e7e7b70231baa011c93b91c4ef1aa2;origin=https://github.com/PathOfBuildingCommunity/PathOfBuilding;anchor=swh:1:rev:9d77d8caa7565cca82d474d78a702cf61d29be76;path=/src/LaunchInstall.lua
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
#@ SimpleGraphic
-- Path of Building
--
-- Module: Launch Install
-- Installation bootstrap
--

local basicFiles = { "UpdateCheck.lua", "UpdateApply.lua", "Launch.lua" }

local xml = require("xml")
local curl = require("lcurl.safe")

ConClear()
ConPrintf("Preparing to complete installation...\n")

local localBranch, localSource
local localManXML = xml.LoadXMLFile("manifest.xml")
if localManXML and localManXML[1].elem == "PoBVersion" then
	for _, node in ipairs(localManXML[1]) do
		if type(node) == "table" then
			if node.elem == "Version" then
				localBranch = node.attrib.branch
			elseif node.elem == "Source" then
				if node.attrib.part == "program" then
					localSource = node.attrib.url
				end
			end
		end
	end
end
if not localBranch or not localSource then
	Exit("Install failed. (Missing or invalid manifest)")
	return
end
localSource = localSource:gsub("{branch}", localBranch)
for _, name in ipairs(basicFiles) do
	local text = ""
	local easy = curl.easy()
	easy:setopt_url(localSource..name)
	easy:setopt_writefunction(function(data)
		text = text..data 
		return true 
	end)
	easy:perform()
	local size = easy:getinfo(curl.INFO_SIZE_DOWNLOAD)
	easy:close()
	if size == 0 then
		Exit("Install failed. (Couldn't download program files)")
		return
	end
	local outFile = io.open(name, "wb")
	outFile:write(text)
	outFile:close()
end
Restart()
clear-smoke.lua · 454 B · ext .lua · seen 7132× in SWH
via unique-primary
swh:1:cnt:987ab40365440347ede593d5969f1a562a453306;origin=https://github.com/vorsgren/DFmark-linux;anchor=swh:1:rev:9e1950fc1ff57629a2a492bec617bf52006f9a47;path=/df_linux/hack/scripts/clear-smoke.lua
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
-- Removes all smoke from the map

--[====[

clear-smoke
===========

Removes all smoke from the map. Note that this can leak memory and should be
used sparingly.

]====]

function clearSmoke(flows)
    for i = #flows - 1, 0, -1 do
        if flows[i].type == df.flow_type.Smoke then
            flows:erase(i)
        end
    end
end

clearSmoke(df.global.flows)

for _, block in pairs(df.global.world.map.map_blocks) do
    clearSmoke(block.flows)
end
remove-wear.lua · 1004 B · ext .lua · seen 2310× in SWH
via unique-primary
swh:1:cnt:72e92b0a5fe779391e29c98a69f739e80653dcd2;origin=https://github.com/DFHack/scripts;anchor=swh:1:rev:b0fe5172ff1ad74162ccdb0f161c88ddf7c40270;path=/remove-wear.lua
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
-- Reset items in your fort to 0 wear
-- original author: Laggy, edited by expwnent

local args = {...}
local count = 0

if not args[1] or args[1] == 'help' or args[1] == '-h' or args[1] == '--help' then
    print(dfhack.script_help())
    return
elseif args[1] == 'all' or args[1] == '-all' then
    for _, item in ipairs(df.global.world.items.other.IN_PLAY) do
        if item:getWear() > 0 then --hint:df.item_actual
            item:setWear(0)
            count = count + 1
        end
    end
else
    for _, arg in ipairs(args) do
        local item_id = tonumber(arg)
        if item_id then
            local item = df.item.find(item_id)
            if item then
                item:setWear(0)
                count = count + 1
            else
                dfhack.printerr('remove-wear: could not find item: ' .. item_id)
            end
        else
            qerror('Invalid item ID: ' .. arg)
        end
    end
end

print('remove-wear: removed wear from '..tostring(count)..' items')

Contribute — propose a file extension

Tell us where to find evidence about Lua (mapped to pl/lua). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Lua/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← LTspice Symbol Lua Joust →