lua-users home
lua-l archive

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


As an artist, the state machine concept is so useful that we even
created the "Turing" parser on top of Lua:

#-- 200 gamme Do mineur
#-- claire
. 200         -> m2
m2 2:play(36) -> m2
m2 5:play(31) -> m2
m2 6:play(38) -> m22
m2 1:play(37) -> m2  #-- security: goto start

The syntax is "[from state A] [on token X]:[action (Lua) Z] -> [new
state B]. The '.' is the default action for all states on the given
token.

In order to debug and review such code we had two tools: export to
graphviz and printout of the jump tables
(http://gaspardbuma.org/en/post400.html).

Gaspard

On Fri, Jan 28, 2011 at 10:44 PM, Axel Kittenberger <axkibe@gmail.com> wrote:
>
> > You EXCELLED at focusing, as far as I can see, which is why Lua is as strong
> > as it is, in my eyes. It found it's niche I thought. Sometimes it looks a
> > lot like you don't care to cater to it. I can appreciate if you simply don't
> > care (no sarcasm). But I am a little surprised and would like to understand
> > that better. I guess I can even live with sticking with Lua 5.1 forever. It
> > might be all you ever need and the fallacy, to think that Lua should not
> > evolve into something else. But really, that might confuse a lot of people.
>
> Just to add, maybe there different views to what its niche actually
> is. As I perceived it and have chosen for it, it was:
>  * easy, small, fast
> Thats makes it the ideal pick for gaming industry, or configurable
> network systems etc. To some degree companies can even expect their
> artists to script some game environments in Lua. Small and fast are
> nondisputed, Lua is very good in doing that. I though easy was also a
> major design goal, since arrays start with 1, there are no +=, ++
> operators, which make code look more "scary" to non-longtime-coders. I
> just got obeservation that easy either went of the radar slowly, or
> maybe it never really was and was just coincidence it happened to fit
> it as well. I suppose many of the arguments in the last months can be
> perceived as instances of the different view of the group that sees
> Lua as a beginner coders choice (for gaming, or their user group) and
> the ones that dont.
>