Josh Haberman | 1 Feb 01:05
Picon

Re: ltable.c table deletion

On Jan 31, 2012 at 2:06 PM, Doug Currie wrote:
> On Jan 31, 2012, at 3:01 PM, Josh Haberman wrote:
> > […]  it occurred to me that Brent's
> > variation (evicting a colliding element that is not in its main
> > position) prevents chain coalescing
>-
> No, it doesn't. Imagine a full hash table with all keys in their main
> position (perfectly hashed). All chains are coalesced.

Like Lua, I am using chained scatter (what you call "explicit
chaining" below), so in the scenario you describe every entry's "next"
pointer will be NULL and no chains will be coalesced.

> > […] I was surprised that Lua didn't
> > implement it.
>
> Note that Lua uses explicit chaining (with next fields in the TKey),
> so chains never coalesce at the expense of one link pointer per hash
> bucket.

Chains don't coalesce in Lua *only because* Lua uses Brent's variation.
With naive chained scatter they can coalesce, as described in my
original link, or to use an even simpler example, insert 1 into this
table (assume the identity hash for integers):

      val next
     +---+----+
  0  | 0 |  1 |--+
     +---+----+  |
  1  | 4 |    |<-+
(Continue reading)

David Favro | 1 Feb 01:22

Re: Where Lua *is* used

On 01/31/2012 05:32 PM, Luiz Henrique de Figueiredo wrote:
>> Let's focus on where Lua *is* used ;)
>>
>> I start listing the applications that I remember:
> 
> As mentioned in http://www.lua.org/uses.html :
> 	The wiki contains a list.		http://lua-users.org/wiki/LuaUses
> 	Wikipedia contains another list.	http://en.wikipedia.org/wiki/Lua_%28programming_language%29#Applications

Also on Wikipedia:
http://en.wikipedia.org/wiki/Category:Lua-scriptable_software

curt | 1 Feb 01:35

Re: LuaJIT and Lua 5.2?

On 1/31/2012 3:36 PM, Marc Balmer wrote:
>
>
>
> Am 31.01.2012 um 21:23 schrieb Francesco Abbate<francesco.bbt <at> gmail.com>:
>
>>> It depends. There is a cost (syntax and run-time) to exception
>>> handling in Lua.  We know that goto is low-level, but it is not
>>> inherently evil in the hands of someone who knows that it's the most
>>> optimal solution.  And as for 'bad code', the best solution is
>>> education, not limiting the language so that it can be 'safe'
>>> according to the current definition of 'safe'.
>>>
>>> Gotos are also useful for code generation, particularly if one has
>>> some kind of #line pragma as well.
>> I'm sorry but I don't agree on this point. Adding a bad feature like
>> goto to facilitate automatic code generation, this is a bad argument.
>>
>> I will be afraid to see in future Lua libraries and application using gotos :-/
>>
>> Francesco
> gotos are a good concept.
>

They come up. I find the need of a goto about... once a year. Usually to 
error out of a long init-chain that just looks too hideous without it.

Last time was to leave a Python macro pair that created a scope.

Unless, of course, you count break, continue and switch/case in which 
(Continue reading)

HyperHacker | 1 Feb 02:26
Picon

Re: LuaJIT and Lua 5.2?

On Tue, Jan 31, 2012 at 17:35, curt <curt <at> northarc.com> wrote:
> On 1/31/2012 3:36 PM, Marc Balmer wrote:
>>
>>
>>
>>
>> Am 31.01.2012 um 21:23 schrieb Francesco Abbate<francesco.bbt <at> gmail.com>:
>>
>>>> It depends. There is a cost (syntax and run-time) to exception
>>>> handling in Lua.  We know that goto is low-level, but it is not
>>>> inherently evil in the hands of someone who knows that it's the most
>>>> optimal solution.  And as for 'bad code', the best solution is
>>>> education, not limiting the language so that it can be 'safe'
>>>> according to the current definition of 'safe'.
>>>>
>>>> Gotos are also useful for code generation, particularly if one has
>>>> some kind of #line pragma as well.
>>>
>>> I'm sorry but I don't agree on this point. Adding a bad feature like
>>> goto to facilitate automatic code generation, this is a bad argument.
>>>
>>> I will be afraid to see in future Lua libraries and application using
>>> gotos :-/
>>>
>>> Francesco
>>
>> gotos are a good concept.
>>
>
> They come up. I find the need of a goto about... once a year. Usually to
(Continue reading)

HyperHacker | 1 Feb 02:31
Picon

Re: Where Lua *is* used

On Tue, Jan 31, 2012 at 17:22, David Favro <lua <at> meta-dynamic.com> wrote:
> On 01/31/2012 05:32 PM, Luiz Henrique de Figueiredo wrote:
>>> Let's focus on where Lua *is* used ;)
>>>
>>> I start listing the applications that I remember:
>>
>> As mentioned in http://www.lua.org/uses.html :
>>       The wiki contains a list.               http://lua-users.org/wiki/LuaUses
>>       Wikipedia contains another list.        http://en.wikipedia.org/wiki/Lua_%28programming_language%29#Applications
>
> Also on Wikipedia:
> http://en.wikipedia.org/wiki/Category:Lua-scriptable_software
>

Doesn't the game Roblox use Lua? I think it's fairly popular judging
from the amount of spam I see relating to it on Youtube. :)

--

-- 
Sent from my toaster.

David Manura | 1 Feb 03:20
Favicon

Re: LuaJIT and Lua 5.2?

On Tue, Jan 31, 2012 at 3:05 AM, Steven Johnson
<steve <at> xibalbastudios.com> wrote:
> At a quick glance, there's a part in each of the bit32_* functions
> that looks a little suspicious, e.g. in bit32_bxor:

Thanks, fixed.

marbux | 1 Feb 03:47
Picon

Re: Where Lua *is* used

CodeMAX is a simple and fast text editor with the possibility to add
custom features using the script language Lua. By creating plugins
with Lua you can customize CodeMAX on your own. For exsample it is
possible to build a complete IDE for different programming languages
like C/C++, PHP, Pascal or Basic. <http://codemax.luaforge.net/>

Best regards,

Paul

Doug Currie | 1 Feb 03:47
Picon

Re: ltable.c table deletion

On Jan 31, 2012, at 7:05 PM, Josh Haberman wrote:

> This is the key result that I realized but couldn't find
> published anywhere, which made me wonder whether this was previously
> known.  All algorithms I could find published used the (much) more
> complicated and expensive removal algorithm.

… which saves a next pointer at every bucket. I.e., the cost of the simpler deletion algorithm is a next
pointer at every bucket, a cost that many implementations go to great pains to avoid (because cutting the
size of the hash table fits more of it in cache). [Lua's hash table is a great piece on engineering, and I'm
not knocking it, just trying to point out why many other implementations make different choices.]

-- e

marbux | 1 Feb 03:57
Picon

Re: Where Lua *is* used

Textadept. "In a world where code bloat is commonplace and application
speed is second to its number of features, Textadept breaks that
trend, aiming to stay minimalist and fast, but at the same time being
ridiculously extensible. At its core lies less than 2000 lines of C
code, and that is how it always will be. While other editors rely on
numerous plugins for a wide range of functionality, recordable macros
to speed up workflow, and shell scripts to quickly transform text,
Textadept takes it to the extreme: it gives you complete control over
the entire application using the embedded Lua language. Lua is one of
the fastest scripting languages available and has a very small
footprint. In fact, most of Textadept is written in Lua. The
application's incredibly fast startup time and operation attest to
Lua's worthiness."
<http://caladbolg.net/luadoc/textadept/manual/1_Introduction.html>.

Best regards,

Paul

Miles Bader | 1 Feb 04:45
Picon
Gravatar

Re: LuaJIT and Lua 5.2?

Francesco Abbate <francesco.bbt <at> gmail.com> writes:
> 2012/1/31 Miles Bader <miles <at> gnu.org>:
>> Mike's expressed displeasure with some of them (e.g. the details of
>> the 5.2 bit library), and approved of others (e.g., "goto").
>> I suspect luajit will likely over time add various 5.2 features as
>> time and funding allow (and as clients request, of course).
>
> I didn't find anything where Mike was expressing his approbation for
> the goto statement. I only found that:
...
> Could you give a reference that support your statement ?
> Otherwise  Edsger Dijkstra made his point a lot of time ago about the
>...

No I'm not going to put any effort into countering your whine.

Yeah, we all know about Dijkstra.  He was speaking in another time, when
goto was widely abused.  His hyperbole served its purpose, but today is
a different world, and idea of "goto" as some sort of unspeakable evil
whose use is never justified is naive.

-miles

--

-- 
White, adj. and n. Black.


Gmane