lua-users home
lua-l archive

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


David Given wrote:
> Yes, but you don't want to sacrifice speed unnecessarily. The advantage of 
> the above syntax is that it's entirely obvious to the compiler when you're 
> matching against a specific item (with <expr> [, <expr>...] then) or 
> against an expression (with <varname> if). This makes it trivial for, say, 
> the JIT to construct real jump tables.

Jump tables are for AOT compilers. JIT compilers have better ways
to optimize this, like profile-directed tree-dispatch. And it
shouldn't matter which control-flow constructs in the source
language generated the dispatch.

[However I'm amazed to see a glimpse of a thought about semantics
in the boring bi-monthly discussion on shallow syntax matters.]

--Mike