3 ms·
Yes 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 w
by vrighter 11mo ago
Yes 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).