|
On Mar 10, 2014 8:51 PM, "Hisham" <h@hisham.hm> wrote:
> Nice! I've done something roughly similar to this in a project at work
> (where development time was more at a premium than execution time).
> Apart from some goodies that handled our OO-in-C classes as special
> cases, the API was basically down to two vararg functions,
> Bind_arguments and Bind_results.
Splitting the arguments and the return values may allow llua to take advantage of printf and scanf syntax checks in the compiler. You'd have to abuse the syntax a little.
rv = call(G, io_read, "%p %s %d", Gstdin, "*number", 1024);
if (rv) {
values(G, "%d %s", &n, &s);
}
This would be useful for people still mostly in the stack world too I think.
My feeling is that failure to unref is going to be a problem. Many people could use something like the Objective C pool-per-event, where their app top-level loop frees and/or complains about objects allocated but not explicitly moved to a long-term pool after each event. For web servers it would be per-request, maybe per-frame on games, etc.
Jay