lua-users home
lua-l archive

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


>From lua-l@tecgraf.puc-rio.br Tue Jun 29 15:36:50 1999
>From: Norman Ramsey <nr@cs.virginia.edu>

> > However, 3.2 includes a TAILCALL opcode...
>
>This is all you need for proper tail recursion, and it is more general.

right, but the vm interpreter still needs to check whether the function being
called in the tail is the same that is being run because of late binding:
the following is an example from Roberto:

	function f(x,y,z)
		f=g
		return f(y,z,x)
	end

so, the second 'f' refers to a different function.
it's doable, but it remains to be seen whether it's worth it.

> > Like someone said, "Lua is the speed demon of scripting languages" :-)
>
>Any ideas why?  Did you pay special attention to speed?  Do any
>profiling?

No idea. I don't think we paid special attention to speed, but we do time our
temporary changes to see whether they make Lua slower or not (ignoring 10%
diferences).
I think we did some profiling in the beginning; one result was that we wrote
our own lexer instead of using yacc. I also recall that sscanf, atof and
friends were too slow for reading numbers.
--lhf