lua-users home
lua-l archive

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


2013/6/28 Tim Hill <drtimhill@gmail.com>:
> Regarding the "I see very little use for it" argument.

You apparently have a use for it. Since it's been shown it's easy to implement
that 'empty' value on top of existing Lua, and in a way that is, from Lua
code, indistinguishable from the actual integration of the concept in the VM,
did you actually implement it?

> I've now been involved in three MAJOR projects using Lua in a significant or
> key role (we are talking a LOT of Lua code and a LOT of C libraries here).
> In each case we have hit against real issues with interfacing between C and
> Lua where the lack of an "empty" feature has caused us to create workarounds
> of various types. And of course we've worked around them. But it left me
> thinking hard about how much simpler this would be if I had an "empty" value
> in the language and a few extra APIs like "lua_isempty()".

So, in these three MAJOR projects, did you extend Lua to have that "empty"
value? Given the relatively small size of Lua compared to any project that can
be qualified as MAJOR in capitals, there was no reason not to.

Did you implement the "empty" value in the same way for the three projects?
Did the concept (and eventually the implementation) apply equally well to the
three projects?

What are the few extra APIs that you had to define?

Did you initially abuse the concept to later realize it was useful in some
cases, but not that much in others?

> However, as you state, there is essentially zero chance of this happening,

I may be overlooking something, but that whole modification of Lua is much
less than 1000 lines of code, which is basically nothing (and I feel I'm being
quite generous with such an estimate). It's been said and repeated that there
is no technical obstacle to its implementation. So did you make it happen? If
not, why not?

When basic logic doesn't convince, hard numbers can help. A detailed analysis
of a use case and a conclusion in the style of "my implementation of 'empty'
shaved X% of my code base, improved performance by Y%, and fixed Z bugs" will
certainly gain you some supporters.

> "how dare you suggest we meddle with perfection!".
>
> It would be amusing to speculate how people would react if Lua had always
> had "empty" and I posted a suggestion that it should be removed as being
> unnecessary, since there were obviously so many workarounds. :)

I for one would have quoted Saint-Exupéry to support such a case :-)