This page tracks which parts of the Lua 5.2 standard library MoonSharp implements, on which platforms, and which functions can yield.

NOTE : this reflects the state of the standard library as captured in the original status document. It has not been re-verified against the 3.0.0 beta - see the changelog for recent changes.

Legend
New in Moon#Function has been introduced in Moon# and is not present in Lua 5.2
DoneImplemented completely
Done, with differencesImplemented, but has differences from the Lua version (detailed in comments)
Not done, issuesNot completed yet
Unsupported, stubUnsupported, but implemented as a stub for compatibility
UnsupportedUnsupported and likely support will be limited or non-existent also in the future
Not done yetNot even started

The Yield column says whether the function can yield a coroutine: YES it can, NO it cannot, – not applicable.

API Status Yield CLR Mono Unity Differences Yielding notes
_GDone–✓✓✓
_VERSIONDone–✓✓✓
_MOONSHARPNew in Moon#–✓✓✓A table, containing several fields including moonsharp version, platform and emulated lua version.
assertDone–✓✓✓
collectgarbageDone–✓✓✓Some arguments ignored
dofileDoneYES✓✓✓
errorDone–✓✓✓
getmetatableDone–✓✓✓
ipairsDoneYES✓✓✓
loadDoneNO✓✓✓A function as input cannot yield.
loadsafeNew in Moon#NO✓✓✓Same as loadfile, but with better handling of default _ENV for sandboxing.
loadfileDone, with differences–✓✓✓stdin as input is not supported.
loadfilesafeNew in Moon#–✓✓✓Same as loadfile, but with better handling of default _ENV for sandboxing.
nextDone–✓✓✓
pairsDoneYES✓✓✓
pcallDoneYES✓✓✓
printDoneNO✓✓✓__tostring cannot yield when called from print
rawequalDone–✓✓✓
rawgetDone–✓✓✓
rawlenDone–✓✓✓
rawsetDone–✓✓✓
requireDoneYES✓✓✓Minor internal differences
selectDone–✓✓✓
setmetatableDone–✓✓✓
tonumberDone, with differences–✓✓✓Only bases between 2 and 10, and base 16 are supported.
tostringDoneYES✓✓✓
typeDone–✓✓✓
xpcallDone, with differencesNO✓✓✓Double faults are appended to error and ignored.Code can yield, but the error message handler cannot.
bit32.arshiftDone✓✓✓
bit32.bandDone✓✓✓
bit32.bnotDone✓✓✓
bit32.borDone✓✓✓
bit32.btestDone✓✓✓
bit32.bxorDone✓✓✓
bit32.extractDone✓✓✓
bit32.lrotateDone✓✓✓
bit32.lshiftDone✓✓✓
bit32.replaceDone✓✓✓
bit32.rrotateDone✓✓✓
bit32.rshiftDone✓✓✓
coroutine.createDone✓✓✓
coroutine.resumeDone✓✓✓
coroutine.runningDone✓✓✓
coroutine.statusDone✓✓✓
coroutine.wrapDone✓✓✓
coroutine.yieldDone✓✓✓
debug.debugDone✓✓✓
debug.getuservalueDone✓✓✓
debug.gethookUnsupported✗✗✗Use the debugger infrastructure.
debug.getinfoUnsupported✗✗✗Function is heavily dependent on implementation details.
debug.getlocalUnsupported✗✗✗Function is heavily dependent on implementation details.
debug.getmetatableDone✓✓✓
debug.getregistryDone✓✓✓
debug.getupvalueDone✓✓✓
debug.setuservalueDone✓✓✓
debug.sethookUnsupported✗✗✗Use the debugger infrastructure.
debug.setlocalUnsupported✗✗✗Function is heavily dependent on implementation details.
debug.setmetatableDone✓✓✓Cannot set on userdata as now.
debug.setupvalueDone✓✓✓
debug.tracebackDone✓✓✓
debug.upvalueidDone, with differences✓✓✓Works ok, but returns a number instead of userdata (still, can be used in pretty much the same way).
debug.upvaluejoinNot done yet
dynamic.evalNew in Moon#✓✓✓Evaluates the code passed as a parameter dynamically. All accesses are raw, function calls will raise an error.
dynamic.prepareNew in Moon#✓✓✓Prepares an expression for faster evaluation with dynamic.eval.
file:closeDone✓✓✗
file:flushDone✓✓✗
file:linesDone✓✓✗
file:readDone✓✓✗
file:seekDone✓✓✗
file:setvbufDone✓✓✗
file:writeDone✓✓✗
io.closeDone✓✓✗
io.flushDone✓✓✗
io.inputDone✓✓✗
io.linesDone✓✓✗
io.openDone✓✓✗
io.outputDone✓✓✗
io.popenUnsupported✓✓✗Interprocess comms, stdin and stdout are NOT supported. This however is ok by the Lua standard.
io.readDone✓✓✗
io.stderrDone✓✓✗
io.stdinDone✓✓✗
io.stdoutDone✓✓✗
io.tmpfileDone✓✓✗
io.typeDone✓✓✗
io.writeDone✓✓✗
math.absDone–✓✓✓
math.acosDone–✓✓✓
math.asinDone–✓✓✓
math.atanDone–✓✓✓
math.atan2Done–✓✓✓
math.ceilDone–✓✓✓
math.cosDone–✓✓✓
math.coshDone–✓✓✓
math.degDone–✓✓✓
math.expDone–✓✓✓
math.floorDone–✓✓✓
math.fmodDone–✓✓✓
math.frexpDone–✓✓✓
math.hugeDone–✓✓✓
math.ldexpDone–✓✓✓
math.logDone–✓✓✓
math.maxDone–✓✓✓
math.minDone–✓✓✓
math.modfDone–✓✓✓
math.piDone–✓✓✓
math.powDone–✓✓✓
math.radDone–✓✓✓
math.randomDone–✓✓✓Minor differences in accepted inputs (MoonSharp is more tolerant)
math.randomseedDone–✓✓✓
math.sinDone–✓✓✓
math.sinhDone–✓✓✓
math.sqrtDone–✓✓✓
math.tanDone–✓✓✓
math.tanhDone–✓✓✓
os.clockDone✓✓✓
os.dateDone✓✓✓Running on Mono systems might lead to erroneous output due to a Mono bug (11817)
os.difftimeDone✓✓✓
os.executeDone✓✓✗
os.exitDone✓✓✗
os.getenvDone✓✓✗
os.removeDone✓✓✗
os.renameDone✓✓✗
os.setlocaleUnsupported, stub✓✓✗Unsupported, currently a stub
os.timeDone✓✓✓
os.tmpnameDone✓✓✗
package.configDone✓✓✓
package.cpathUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
package.loadedDone✓✓✓
package.loadlibUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
package.pathUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
package.preloadUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
package.searchersUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
package.searchpathUnsupported✗✗✗See Script loaders to see how to customize loading of scripts and packages
string.byteDone✓✓✓Character codes are cropped to 0-255. Use string.unicode to have the unicode code-point.
string.charDone✓✓✓Values > 255 are silently supported (as unicode codepoints)
string.dumpDone✓✓✓Functions with upvalues raise an error as Lua 5.0 did and as Lua 5.2 should do according to documentation.
string.findDone✓✓✓Implementation taken from KopiLua. Patterns cannot contain \0. Use %z instead.
string.formatDoneNO✓✓✓Implementation taken from KopiLua.__tostring metamethod cannot yield.
string.gmatchDone✓✓✓Implementation taken from KopiLua. Patterns cannot contain \0. Use %z instead.
string.gsubDoneNO✓✓✓Implementation taken from KopiLua. Patterns cannot contain \0. Use %z instead.Callback function (if used) cannot yield.
string.lenDone✓✓✓
string.lowerDone✓✓✓
string.matchDone✓✓✓Implementation taken from KopiLua. Patterns cannot contain \0. Use %z instead.
string.repDone✓✓✓
string.reverseDone✓✓✓
string.subDone✓✓✓
string.unicodeNew in Moon#✓✓✓Works just as string.byte would do, but returns the unicode code-point without truncation.
string.upperDone✓✓✓
table.concatDoneNO✓✓✓__len cannot yield
table.insertDoneNO✓✓✓__len cannot yield
table.packDone✓✓✓
table.removeDoneNO✓✓✓__len cannot yield
table.sortDoneNO✓✓✓__lt, __len and the comparison function cannot yield
table.unpackDone✓✓✓

The original spreadsheet is still available as a PDF download.