lua-users home
lua-l archive

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

Hash: SHA1

Mike Pall wrote:
> 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.

I haven't met those before (most of my compiler experience is with AOT stuff),
but I'd have though that would work very nearly as well as an explicit jump
table in the case where you have a contiguous set of integer indices, and
better in practically every other case. As well as making life easier for the
compiler and users. Does LuaJIT do this? Is there any real point trying to
optimise if...elseif...elseif...end sequences?

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

Thank you... I think.

One day I'm going to write a Lua->Lua compiler just to give people something
to play with. Apart from anything else, the boring syntax discussions are
*traditional* by now.

- --
┌── ─── ───────────────────
│ "They laughed at Newton. They laughed at Einstein. Of course, they also
│ laughed at Bozo the Clown." --- Carl Sagan
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -