lua-users home
lua-l archive

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


On Tue, Mar 15, 2016 at 10:53 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> and it's reverse polish notation beyond quick hand calculations coding
> algorithms is hard. I remember the problems with my Lua/C interface of
> forgetting to popping one thing from the stack and run into overflow far
> down the line, or popping one too much and get an error somewhere else etc.

Yes, the Lua C API might be _straightforward_ but it is not _easy_
because stack discipline is hard (at least for my personal head
computational device)

So if you already have a C++ project, use the language's abstractive
power to get something that's easier to reason about. There is choice
here (the 'new' C++ makes such things much easier) which can be
considered a drawback - you have to go shopping. And stackoverflow is
no longer your friend. Perhaps an opportunity to update the Wiki?

Even with C, wrappers make sense. Here's my take on the problem:

https://github.com/stevedonovan/llua

(and yes, it's all about reference-counting)

Does require some semantic impedence matching because it uses 'C smart
pointers' [0]

[0] "There are no smart pointers in C. Only regular pointers with
hidden secrets"