lua-users home
lua-l archive

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


On Sat, Apr 19, 2014 at 3:10 AM, Sean Conner <sean@conman.org> wrote:

>   Hmm ... I'm rereading the man page, and I may not be doing it correctly.
> I may be able to use luaL_Buffer and a fixed-length output buffer, but I'm
> still not going to be hostage to Microsoft (so I'll still use C99 features).

I'm kind of curious to know what you require from C99. :>

The main benefit of using variable-length arrays is allocating on the
stack, which can also be done with alloca() -- both avenues not
possible with C89.  Going the route of luaL_Buffer would still
allocate on the heap (internally using Lua's set allocator function --
which looks like realloc).  I'm continually mad at Microsoft for not
better supporting C99 but in the grand scheme of things I'd rather
skip C99 entirely.  It doesn't add enough to be worth jumping ship.  I
never find myself *needing* something from C99; most code isn't
dramatically improved by the offerings of that standard ((imo)).

(Sorry if this sounds snobby and off-topic -- I've just been thinking
about Lua using a current ANSI standard for a while.)

((Yes I do curse the people who only have C89 runtimes at their
disposal, but nobody completely supports C11 yet... stupid glibc))