lua-users home
lua-l archive

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

David Given wrote:
> Hash: SHA1
> Luiz Henrique de Figueiredo wrote:
>>> Yeah, but that's cheating; it's using a different algorithm.
>> Choosing a better algorithm is the recommended way to improve perfomance, right?
> Yeah, but it doesn't help when you want to compare the performance of the
> *same* algorithm in two different implementations!

Again I find myself in agreement with David!

I think this is an honest comparison of how Lua and Java handle the same
algorithm. The algorithm is quite natural and is expressed identically
in both languages. We Lua lovers learn to avoid the limitations caused
by immutable strings so that we can use it as a feature elsewhere. This
is simply a case where one of Lua's weaknesses is exposed.

Of course another algorithm will do, but it wouldn't be as natural.

I know where LHF is driving the conversation - we always have to keep in
mind the limitations of a language when we decide on an algorithm. But
when that results in the rejection of a very natural form - which is not
a problem in another language - I think it is valid to point this out as
a weakness.

Here in Lualand we have the choice of accepting the limitation or
finding a way to make it less of a limitation. There have been countless
discussions on this topic, even recently. I have not yet seen an
implementation that is acceptable to The Lua Way, so for now I live with
the limitation and program around it by using table.concat() when necessary.


Innovative Concepts, Inc. 703-893-2007 x220