lua-users home
lua-l archive

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


Of course performance matters and drives design decision, so that Lua
uses speed as a selling argument (number 2 in list). So when you start
making classes with multiple inheritances like in PIL, you discover that
using caching instead easily doubles speed of a script and then feel
uncomfortable to have time enough to investigate the tricky issues when
you want to preserve dynamicity (and you think that this is more a
language design issue than a library issue). 

Then I'm ok to say that if speed isn't that utterly important (else you
will use compiled language), you nonetheless realize that core support
can improve things and no one generally complain that a program is too
fast.

Why standard is synonym to poor performance to you? I mean yes standard
is priority one for me. But I would find "foolish" that standard is
implemented the less efficient way. Reasonably fast is hard to determine
in general, but at least when you have an implementation 2x faster for
the same features why to take the slowest? Well, it might still be
reasonable, but then requirements shall be made clear (space,
maintenance...).

I'm in the case where I need something in between Python (- packaging,
API, + training facilities, class support, third part tools including
doxygen) and Lua (+ threads, table syntax, API, - classes, bitwise).
Deciding is difficult and thus in favor of Python that is an easier
choice for non technical reasons. Technically Lua core is much closer to
my needs but not yet there so that the non technical reasons dominate
choice.

I like Lua better, but won't complain if it has standard classes even if
I don't use OO paradigm everywhere, and if it has bitwise operators
(sorry to have different math requirements than in techgraf...). So, I
use yet another class model (~50 loc and a kernel patch for bitwise) but
can't sell it other than usage restricted to configuration and have to
stick to python.
And well I'm not classifying myself in non-programmer dictator but just
exposing what I think are probably quite common (enough?) requirements.

Well now I made my requirements clear, I guess there is no point saying
more. 
Don't want to troll here too much.


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Stefan
Sandberg
Sent: Tuesday, January 15, 2008 12:46 PM
To: Lua list
Subject: Re: Need standard kernel supported class in Lua, was: Macros
andexpressivity

Using performance as a measure on how to dictate the design of semantics

in a higher language sounds utterly foolish imo.

Also, your own arguments seem to undermine themselves.. You don't want 
something that can "easily become a bottleneck", yet you want a
de-facto standard, so does that mean you decide what is reasonably fast
or?

I don't understand why people keep comparing lua with python or tcl or 
anything else, they're not the same thing, for a number of reasons..
The only common denominator is that they're languages and they're 
interpreted, but so what..
You're starting to sound like lua isn't compatible with itself, because 
it's not like python..
If python fits, use it, if lua fits, use it, but what could possibly be 
the point of adjusting lua to be more like python?

The fact that lua is NOT python is what attracts me to it, and I'd 
probably stick to the current version of lua for all time if it started 
changing into the next cool kid
on the block, with a million "non-programmer" dictating what it should 
and should not do.





Grellier, Thierry wrote:
> I'm not complaining about lack of class syntax, but about profusion of
> class syntaxes which furthermore make unclear which inheritance models
> are used.
>
> When quickly doing yet another class model, I realized that caching
> methods can impact a lot script speed. Cleverer caching of class
method
> was improving the speed of my script more than directly using luaJIT.
> That is metatable accesses can easily become a bottleneck with
cascading
> index. 
>
> Loop is not close to be even a de facto standard (who uses it? tolua?
> swig? ...). 
>
> I'd like having a clearly specified class model, well supported not to
> kill performances, and very likely to be largely adopted by third part
> tools. I would bear that this class model has "limitations" (well for
> example I would neither require public/private scopes, nor that if A
> inherit from B and C and that B.c and C.c exists they shall be
> different). Python class model looks a good base (technically and
> socially).
>  
> But it can be really interesting to investigate how dynamic one would
> like to be because dynamicity/caching compromise is hard to find
unless
> the script kernel can extend the design burdens.  
>
> It doesn't mean to remove the existing low level mechanism so that
> anybody can still play with his beloved OO model to experiment or to
> maintain existing code base. 
>
> And I don't believe this would bloat the Lua VM code much more than
> adding competing byte code for class models for those using classes.
It
> can probably be a configurable option for those not using it. What is
> lua_conf intended for? Btw I'm surprised it doesn't include a flag to
> remove parser.
>
> I wish I could have a quick survey on how many man.weeks were spent in
> companies (like adobe, and other) to build and maintain diverging
object
> models.
>
> Quoting another mail (don't want to multiple post)
>
> "Some people have argued they could see no killer feature in Lua that
> could justify not using Python. Well, for me it works the opposite
way.
> None of Python's features are attractive enough to justify the extra
> burden and complexity of embedding Python instead of Lua. "
>
> That is why in the end we embed both... which I dislike because it
means
> that all new efforts are going to python side, and Lua is bound to
> configuration (and well with very small syntax advantage compared to
> python, especially with overriding __attr__ so that it may disappear,
so
> that it may be dropped out while I tend to think that besides class it
> is better using Lua).
>
> Quoting Lua website:
>
> "Lua is simple and powerful
>         ^^^^^^
> A fundamental concept in the design of Lua is to provide
meta-mechanisms
> for implementing features, instead of providing a host of features
> directly in the language. For example, although Lua is not a pure
> object-oriented language, it does provide meta-mechanisms for
> implementing classes and 
>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> inheritance. Lua's meta-mechanisms bring an economy of concepts and
keep
> the language small, while allowing the semantics to be extended in
> unconventional ways."
>
> It sounds very contradictory to me. Associating meta-mechanism to
> simplicity shall make a lot people running away. I would recommend
> splitting "simple" and "powerful" items! And put simple at top of list
> (with mentionning grammar size, keywords number, tables, scalability
of
> learning, used by non programmers).
>
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Ben
> Sent: Monday, January 14, 2008 10:05 PM
> To: Lua list
> Subject: Re: Need standard kernel supported class in Lua,was: Macros
and
> expressivity
>
> That's why LOOP exists.  Just send people on over there, and it's
> cool.  It's not like the mechanisms are already there.  Considering
> all the hoops you have to jump through in other languages, and also
> considering the "syntax weirdity" of Lua already, compared a C-like
> language, what's a couple parentheses in your class definitions?
>
> And isn't LOOP maintained by Tecgraf?  That seems the closest you can
> get to official endorsement.  It's a good system, it works, so why do
> people keep complaining about a lack of class syntax?  Or is it just
> not that well-known?
>
> Cheers,
> Ben
>
>