lua-users home
lua-l archive

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


Subject: [was] First class arrays (implementation & benchmarks) (thanks)

(toppost mode: (though (for my own good) it might be wiser to hide the
following far, far away), but its true, so, better now than later):

(we have a saying here: "from a young or a crazy you are learning the
trueth", but they don't say nothing about, when both conditions are
true (young as a novice here)).

Okey, that was it (it wasn't that hard, wasit?).

Now (warning mode) this is (about the length|lengthy).

On Tue, Mar 27, at 09:46 Agathoklis D.E Chatzimanikas wrote:
> 
> On Tue, Mar 27, at 07:38 Petri Häkkinen wrote:
> 
> > Is no-one else interested in O(1) implementation for the # operator, 
> > native (faster than tables) array implementation and how it can be used
> > to solve the hole issue and issues with pack/unpack?
> > 
> > I think an array type is the right way to go for Lua, considering it solves
> > many issues and also gives a nice perf boost.

> It will be implemented of course. The time has come.
  ~~It will be implemented of course.~~ (scratch this)

I too much trust Dibyendu on this.

On Tue, Mar 27, at 10:02 Dibyendu Majumdar wrote:
> I think hoping for an array subtype in Lua is probably going to
> result in disappointment. The table as the sole data structure is a
> defining feature of Lua; not only that, the semantics associated with
> table iteration and nils, makes it impossible to introduce such a
> subtype without break compatibility with existing programs. Combining
> an array type with a singleton 'undefined' value may be an option, but
> didn't Roberto say in one of his posts:
> 
> > Once 'empty' and 'undef' are values, you break all those properties.
> 
> > I think we cannot use a value to represent the absence of a value, no
> > matter how many no-value values we add. It is a contradiction. Several
> > languages followed this path, always with bad results.
> 
> So it seems that the idea of a singleton 'undefined' value is also not
> acceptable.
> 
> Of course we could see a new Lua language definition in 6.0 that makes
> a clean break from 5.x as Hisham suggested. But if I were asked to bet
> on it I would probably say that an array subtype will not happen.

Disappointment is a terrible terrible feeling, noone should get this.

But this comes mostly when we are cultivate expectations; if we stop
doing that, at both ends, then we are probably set.

(quite a lot of this (i say this by feeling and not with any kind of
logic), is happening because first: noone till now provided the golden
solution and quite probably Roberto feels a lot of preasure to fix this,
but how?)

> But if I were asked to bet on it I would probably say that an array
> subtype will not happen.

Loosing a bet is again a terrible terrible thing. However:

On Wed, Mar 14, at 03:24 Roberto Ierusalimschy wrote:
> Once 'empty' and 'undef' are values, you break all those properties.
> 
> I think we cannot use a value to represent the absence of a value, no
> matter how many no-value values we add. It is a contradiction. Several
> languages followed this path, always with bad results.

(kindergarden here!!! ((slightly evil grin) (about the "always with
bad results") (i do not like this always, is not fair (its an absolutism))))

(ok here is my understanding (please correct))

array[0] guarantee the object location in memory, Okey? so,

0 -> sizeof (obj) 1 element
  -> sizeof (obj) 2 elements
  ...

and iterates over the sequense until it get a signal that it will mean
END (like):

str[idx] = '\0';

doesn't guarantee the end of a C string (or array of char objects) and
therefore its length, counting from zero -> idx - 1 ?

I can not still understand why for Lua is so difficult to define that end
as everybody else do (slightly evil grin)?

Or why is so difficult to express the following:

one of my elements doesn't __yet__ has a usefull value, but I do want to
be part of the length (do not throw it out (yet) of the table)
(unless this is possible today, as i said i don't write in Lua)
If it's possibly, forgive me.



[...]
(ok, this was used to be quuuuite real lengthy (but the last second before
i send, i regreted it).

(a long story short) The time has come.

After (10 days) that i got involved, with this rude way, its time to
leave Lua and Sun, moon and ravi and to goto back to the earth and to
the cave:).

earth:

https://github.com/agathoklisx/

(here is my code (shameless plug))

cave: some goats, some plants, some kids (4), some friends (many many),
some enemies (oh no enemies, everyone is dead :) (kidding (extreme jokes
like those ones from that guy (col field or something) (from the catcher
in the rye)))

But before to go back to my cave.

I have to ask sorry from Roberto, but i had to do my duty as a human
being, that is that we can not turn our ash away from the unjustification
(as that's what i believe was happened when he treated you (as a matter
of speech) like 12 years old kids; when shouting at you and without asking
a single sorry)
(Kudos to Sean about his expression to go against the waves).

so i became rude.

(one last thing) because i have to get it out of me (because its painfull)

I know that Paige Depol lives somewhere in France, and I think
that also Pierre and Etiene might live there, so it might be possibly wise, that
it might be able to make a try, to find her, and to say to her, that some of
the lua community thought (for a second) that you are the right guy to lead
the programming section in a project which could be described with the following
sentence (though practical impossible)

A Unified Lua that will Unite the Poor Programming Languages Universe
and delibarate humans from the fear of Programming and that will provide
               FREEDOM TO SELF EXPRESSIONISM
with a Decent  And       **__PROUD__**    Way full of Logic and shameless emotions.

But this is not i wanted to say.

To Dirk:

Dirk, you are the only one that will understand, (remember about a question in
Greek Diacritics (right?)))

three days ago (before that letter) and when i was going down to the spring to
get water... happened something reeeeeaaaaal strange. Suddenly and without an
apparent reason I started to cry, and i felt like talking to each other (i know 
that might be from the drugs, but it was so scary real):

we said something like:
 - i know (at least twise) and
 - i had to and|or i can not do
 - i wish to be|was [t]here

(it was my fantasy? (quite possible))

(they weren't sorrow tears, but exact the opossite)

Thanks.
  Αγαθοκλής

p.s., (please cc me (for anything consern the above) as i intent to leave
this forum (as punishment for being obvious rude) in 10 days or something.

  goto end ();

> Regards
> Dibyendu

end:

Best and Happy Eastern Time to Everybory.

To the Thessaly tribe to who i devote my fucking life.

p.s.,
you know Daurni you are my favorite Lua coder (what a situation!)