lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Aug 23, 2014 at 1:11 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:

> Ah, but then you're depending on the hidden binary representation of
> userdata. In this case, files are represented differently in Lua 5.1,
> 5.2 and LuaJIT 2 (which is why using Lua file objects from C is a
> delicate business). I think this encapsulation is a feature, not a
> bug;  otherwise the representation cannot change or evolve since
> client code has come to depend on particular byte layouts.

I understand that platform and architectural differences exist, I
simply want the freedom to shoot myself in the foot without touching C
:p

PS: dumping the FILE* struct is just an example, I'd want it to be
that easy -- I have other userdata I'd like to introspect that would
go much faster in Lua if they could be treated like strings (with a
debug library switch for security reasons).

> Au contraire, it makes me happy, because then Lua is not slowed down
> by having to call those dummies.  What is so hard about recompiling
> Lua?  Granted, one cannot then do one's favourite tricks with the
> stock Lua interpreter, but excessive flexibility hurts general
> performance.

One cannot package a threading library that uses LD_PRELOAD against
the distributed stock Lua -- one has to convince the user to recompile
their Lua :p  One is quite sad.