lua-users home
lua-l archive

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

Alex Queiroz wrote:
>      One state machine per top-level function? Really, this is still
> no reason for complaining about a few locals shared *per state
> machine*. How many top-level functions do you have to analyse at the
> same time?

Each top-level function is a C function. Each such function turns into a
state machine which represents the flattened basic block graph which is
the contents of the function. C functions call each other reentrantly,
which means my state machines need to be able to call each other
reentrantly. Trust me, I'm creating new state machines *very frequently*.

Using goto, the overhead of a state machine is nil, as the state is
encoded in the Lua program counter and locals are directly accessible
without needing heap cells. Each C function turns into precisely on Lua

┌─── ───── ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature