Skip to content

Instantly share code, notes, and snippets.

Lua Compatibility Matrix

🟩: This function or field is supported unconditionally in this version.
🟨: This function or field is behind a LUA_COMPAT_* define and may or may not be available.
πŸŸ₯: This function or field will not be present in this version under any condition.

Feature Lua 5.1 Lua 5.2 Lua 5.3 Lua 5.4 Lua 5.5
Base Library 🟩 🟩 🟩 🟩 🟩
assert(v, [msg]) 🟩 🟩 🟩 🟩 🟩
@truemedian
truemedian / clock_gettime.lua
Last active February 28, 2025 21:14
Windows / Posix compatible clock_gettime(REALTIME) ffi bindings.
local ffi = require 'ffi'
local bit = require 'bit'
local clock_gettime
if ffi.os == 'Windows' then
local UNIX_TIME_START = 0x019DB1DED53E8000LL
local TICKS_PER_SECOND = 10000000LL
ffi.cdef [[