Edit on GitHub

Differences

Nelua had to reimplement all Lua libraries. Due to this some functions are not implemented or can’t be implemented. This page explains availability of Lua functions in Nelua.

Implemented - ✔

Not Implemented Yet - ❌

Never or N/A - ✖

Basic and globals

Function Status Nelua Library Remarks
_G   _G doesn’t exist in Nelua due to missing dynamic in C (rephrase me please).
_VERSION basic Returns Nelua version instead of Lua version.
assert basic  
collectgarbage allocators.gc Only collect, stop, restart, count and isrunning arguments.
dofile   Nelua can’t compile at the runtime.
error basic  
getmetatable basic  
load    
loadfile    
next iterators  
pairs iterators Aliased to ipairs right now.
ipairs iterators  
pcall basic  
print inlined Nelua generates print function for each type.
rawequal basic  
rawget basic  
rawlen basic  
rawset basic  
require Nelua compiler Exists as compiler function.
select basic  
setmetatable basic  
tonumber stringview  
tostring string As Lua this function uses __tostring, however Nelua also has __tostringview which exists in stringview library.
type traits  
warn basic  
xpcall basic  

Coroutine

❌ The library is not implemented yet.

Debug

❌ The library is not implemented yet. For debugging use --debug flag and a C debugger.

IO and FILE*

Nelua has additional functions in this library. See here.

Function Status Nelua Library Remarks
io.close io  
io.flush io  
io.input io  
io.lines io  
io.open io  
io.output io  
io.popen io  
io.read io Doesn’t support *n format and multiple arguments.
io.stderr io  
io.stdin io  
io.stdout io  
io.tmpfile io  
io.type io  
io.write io Doesn’t support multiple arguments.
file:close filestream  
file:flush filestream  
file:lines filestream  
file:read filestream Doesn’t support *n format and multiple arguments.
file:seek filestream  
file:setvbuf filestream  
file:write filestream Doesn’t support multiple arguments. Doesn’t return the file itself.

Math

Nelua has additional functions in this library. See here.

Function Status Nelua Library Remarks
math.abs math  
math.acos math  
math.asin math  
math.atan math  
math.atan2 math  
math.ceil math  
math.cos math  
math.cosh math  
math.deg math  
math.exp math  
math.floor math  
math.fmod math  
math.frexp math  
math.huge math  
math.ldexp math  
math.log math  
math.log10 math  
math.max math  
math.maxinteger math  
math.min math  
math.mininteger math  
math.modf math  
math.pi math  
math.pow math  
math.rad math  
math.random math The same as in Lua 5.4.
math.randomseed math The same as in Lua 5.4.
math.sin math  
math.sinh math  
math.sqrt math  
math.tan math  
math.tanh math  
math.tointeger math  
math.type math  
math.ult math  

OS

Function Status Nelua Library Remarks
os.clock os  
os.date os Doesn’t support formats. Only %c
os.difftime os  
os.execute os POSIX status codes are not translated.
os.exit os  
os.getenv os  
os.remove os  
os.rename os  
os.setlocale os  
os.time os Default value for .hour is 0 not 12.
os.tmpname os Uses mkstemp on POSIX.

Package

✖ Nelua doesn’t have a module system.

String

Nelua has additional functions in this library. See here and here.

Function Status Nelua Library Remarks
string.byte stringview No multiple arguments. Errors on failure.
string.char string Only for string. No multiple arguments.
string.dump string No interpreted functions.
string.find stringview Patterns are not supported. Returns 0, 0 instead of nil if nothing was found.
string.format string No multiple arguments.
string.gmatch string  
string.gsub string  
string.len stringview  
string.lower string  
string.match string  
string.pack string  
string.packsize string  
string.rep string  
string.reverse string  
string.sub string  
string.unpack string  
string.upper string  
string.__len stringview  
string.__eq stringview  
string.__lt stringview  
string.__le stringview  
string.__sub stringview  
string.__add stringview  
string.__pow stringview  
string.__unm stringview  
string.__div stringview  
string.__idiv stringview  
string.__mul stringview  
string.__mod stringview  

Table

❌ Dynamic tables are not implemented yet.

UTF-8

❌ Not implemented yet.

FAQ »