3 ms·
> Lua doesn't come with much. Just some very basic file io (not even including listing files) Don’t most people simply use the LuaFileSystem library for that?
by andsoitis 1y ago
> Lua doesn't come with much. Just some very basic file io (not even including listing files)
Don’t most people simply use the LuaFileSystem library for that? https://github.com/lunarmodules/luafilesystem https://github.com/lunarmodules/luafilesystem
I think you (and the project) are using “runtime” when what you really mean environment.
- vrighter 1y agoYes most do. But that is not part of lua. That is just a library one can load. It's written in C. The lua interpreter does not allow any access to the outside world. That rudimentary "built-in" io that's included with lua? It's actually a library shipped with the interpreter, that you need to explicitly load in from the C side of things. Exiting with a process exit code? Optional library. String operations such as pattern matching? Optional library. Math? Optional library. Debugging? Optional library. If you didn't load any of these, then the only I/O you could do is to stdout with the print statement. When you instantiate a new lua state, you are expected to provide your own runtime. It's a language designed to be embedded in other software. Take, for example, libc. It's the C runtime. It doesn't compile or interpret C. libc is just a bunch of C code (with assembly sprinkled in, of course).