lua-users home
lua-l archive

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


On Thu, Feb 18, 2010 at 15:00, Mike Pall <mikelu-1002@mike.de> wrote:
> No, both generate the same code and are the same speed. Your
> measurements are too short and your system does not provide enough
> timing accuracy (desktop Linux nowadays uses 250Hz => 4ms).

I'm on OS X, but I guess it doesn't change you point.

> $ TIMEFORMAT="%U"
> $ time luajit while.lua
> 0.012
> $ time luajit _while.lua
> 0.012
> $ time luajit _while_recursive.lua
> 0.012

That's amazing :-)
Tail calls as fast as native loops will bring so many possibilities...
I'm thinking of "Lambda, the Ultimate Goto" and it's siblings :-) (see
http://library.readscheme.org/page1.html for those who haven't read
them yet).