[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Proposal: Virtualization of Filesystem Operations for Lua 5.2.
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 4 Nov 2011 06:46:28 +0200
> While the unification of stream and block io in the unix world is a great
> thing, I tend to not make it part of the "fs" concept. stdin/stdout/stderr
> is a concept which might be available and supported on platforms of typical
> Lua standalone interpreters, but is not a feature found and needed in all
> situation where a Lua interpreter is embedded.
This thread started out so promisingly: proposal of an extra
abstraction layer for filesystems to hide as much detail as possible
from the Lua programmer. Please, avoid arguments requiring terms like
"the unix world" and "supported on platforms".
The argument against memory streams is not Unix vs the rest of the
world, it's that Lua has no need of it. For input we have
string.match and string.gmatch and need nothing more. For output,
well, memory streams are mutable string buffers. Is the Lua
programmer to be allowed to write arbitrary bytes to a designated
portion of memory? We've had that topic before. Policy seems to be:
in the C API, yes, it is even made easy with `luaL_Buffer`; at the Lua